• kindeditor asp.net 模板问题 clientidmode="Static"


    1、为了防止asp.net 修改 id, 必须加上clientidmode="Static"   .

    2、关于 kindeditor 的脚本,写在master里面,如下(我要骂人了:link 到子页面的时候,会自动增加../; 但是script不自动增加):

    <meta charset="utf-8" />
        <link rel="stylesheet" href="kindeditor-4.1.11-zh-CN/themes/default/default.css" />
        <link rel="stylesheet" href="kindeditor-4.1.11-zh-CN/plugins/code/prettify.css" />
        <script type="text/javascript" charset="utf-8" src="../kindeditor-4.1.11-zh-CN/kindeditor-all.js"></script>
        <script type="text/javascript" charset="utf-8" src="../kindeditor-4.1.11-zh-CN/lang/zh-CN.js"></script>
        <script type="text/javascript" charset="utf-8" src="../kindeditor-4.1.11-zh-CN/plugins/code/prettify.js"></script>
        <script type="text/javascript">
            KindEditor.ready(function (K) {
                var editor1 = K.create('#content1', {
                    cssPath: '../kindeditor-4.1.11-zh-CN/plugins/code/prettify.css',
                    uploadJson: '../kindeditor-4.1.11-zh-CN/asp.net/upload_json.ashx',
                    fileManagerJson: '../kindeditor-4.1.11-zh-CN/asp.net/file_manager_json.ashx',
                    allowFileManager: true,
                    afterCreate: function () {
                        var self = this;
                        K.ctrl(document, 13, function () {
                            self.sync();
                            K('form[name=example]')[0].submit();
                        });
                        K.ctrl(self.edit.doc, 13, function () {
                            self.sync();
                            K('form[name=example]')[0].submit();
                        });
                    }
                });
                prettyPrint();
            });
        </script>
        3、关于 kindeditor 的脚本,自己的页面里面 都补上 ../

    4.  

    <asp:TextBox ID="content" runat="server" TextMode="MultiLine" Width="800px" Height="400px" ClientIDMode="Static"></asp:TextBox>

    如果你一定需要服务器控件,那么加上红色的那个属性,加上了你设定的id值它就不会被改变,建议你了解一下ClientIDMode,.NET4的新特性。

  • 相关阅读:
    Python 直接赋值、浅拷贝和深度拷贝解析
    Python __name__属性
    Java 中动态 JSON 对象的使用
    Java Spring 中使用 @Valid 进行参数校验
    NAT 网络地址转换(2016)
    深入理解 iptables 和 netfilter 架构
    RFC 1180:朴素 TCP/IP 教程(1991)
    云计算时代携程的网络架构变迁(2019)
    编程语言中的 6 种内存模型(2016)
    如何基于 Cilium 和 eBPF 打造可感知微服务的 Linux(2019)
  • 原文地址:https://www.cnblogs.com/qqhfeng/p/9265284.html
Copyright © 2020-2023  润新知