zoukankan      html  css  js  c++  java
  • 组件开发中的内嵌资源引用

    类名字空间前资源注册
    [assembly: System.Web.UI.WebResource("XXX.js.FilePlugin.js", "text/javascript")]

    OnPreRender事件
                //资源名称
                string _strResourceKey = ""; //资源名称
                ClientScriptManager _csm = Page.ClientScript;


                    //if (this.Page.Header.FindControl(_strResourceKey) == null)
                    //{
                    //    string _src = _csm.GetWebResourceUrl(this.GetType(), _strResourceKey);

                    //    Literal _literal = new Literal();
                    //    _literal.ID = _strResourceKey;
                    //    _literal.Text = string.Format("\n<script type=\"text/javascript\" src=\"{0}\" ></script>", _src);

                    //    this.Parent.Page.Header.Controls.Add(_literal);                   
                    //}

                    //if (!this.Page.ClientScript.IsStartupScriptRegistered(_strResourceKey))
                    //{
                    //    string _src = _csm.GetWebResourceUrl(this.GetType(), _strResourceKey);
                    //    _src = string.Format("\n<script type=\"text/javascript\" src=\"{0}\" ></script>", _src);
                    //    Page.ClientScript.RegisterStartupScript(this.GetType(), _strResourceKey, _src);
                    //}

                    if (!this.Page.ClientScript.IsClientScriptIncludeRegistered(_strResourceKey))
                    {
                        string _src = _csm.GetWebResourceUrl(this.GetType(), _strResourceKey);
                        Page.ClientScript.RegisterClientScriptInclude(this.GetType(), _strResourceKey, _src);
                    }

  • 相关阅读:
    CocoaPods入门到精通
    SDAutoLayout 一行代码搞定自动布局
    iOS 开发实践之Auto Layout(From Vincent Sit)
    web前端开发_清除浮动
    转 使用Autolayout xib实现动态高度的TableViewCell
    有了Auto Layout,为什么你还是害怕写UITabelView的自适应布局?
    Objective-C 相关Category2
    Objective-C 相关Category
    Mac 破解Adobe Photoshop CS6
    leetcode@ [315/215] Count of Smaller Numbers After Self / Kth Largest Element in an Array (BST)
  • 原文地址:https://www.cnblogs.com/shijun/p/2297883.html
Copyright © 2011-2022 走看看