• WebResource


    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Text;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    [assembly: WebResource("script_include.js", "application/x-javascript")]
    namespace WebControlLibrary1
    {
        [DefaultProperty("Text")]
        [ToolboxData("<{0}:ClientScriptResourceLabel runat=server></{0}:ClientScriptResourceLabel>")]
        public class ClientScriptResourceLabel : WebControl
        {
            [Bindable(true)]
            [Category("Appearance")]
            [DefaultValue("")]
            [Localizable(true)]
            public string Text
            {
                get
                {
                    String s = (String)ViewState["Text"];
                    return ((s == null) ? String.Empty : s);
                }

                set
                {
                    ViewState["Text"] = value;
                }
            }

            protected override void RenderContents(HtmlTextWriter output)
            {
                output.Write(Text);
            }

            protected override void OnPreRender(EventArgs e)
            {
                if (this.Page != null)
                {
                    ClientScriptManager manager1 = this.Page.ClientScript;
                    manager1.RegisterClientScriptResource(typeof(ClientScriptResourceLabel), "script_include.js");
                }
                base.OnPreRender(e);
            }

        }
    }
    当然这个WebResource.axd是不存在的,它只是IIS中的一个ISAPI影射。

  • 相关阅读:
    C- c常见问题分析
    LEETCODE
    MPI之求和
    在VS2010配置MPI--win7下64位系统
    OpenMP之枚举排序
    OpenMP之数值积分(求圆周率Pi)(sections)
    OpenMP之求和(用section分块完成)
    64位WIN7下安装MPICH2
    Ubuntu下eclipse开发hadoop应用程序环境配置
    C语言字符串函数例子程序大全 – string相关
  • 原文地址:https://www.cnblogs.com/glume/p/1382298.html
Copyright © 2020-2023  润新知