【问题标题】:how do I use wwScriptCompressionModule? for gzip compression with asp.net如何使用 wwScriptCompressionModule?使用 asp.net 进行 gzip 压缩
【发布时间】:2009-03-21 20:10:05
【问题描述】:

好的,我下载了 WestWind Ajax 控件,并将其添加到我的 web.config:

<httpModules>
    <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add name="wwScriptCompressionModule" type="Westwind.Web.Controls.wwScriptCompressionModule,Westwind.AjaxToolKit"/>
</httpModules>

我在我的母版页 .cs 文件中注册我的 js:

Page.ClientScript.RegisterClientScriptInclude(typeof(name_of_masterpage), "scripts", ResolveUrl("~/js/all_script.js"));

现在据我了解,它应该可以工作,但事实并非如此?我可能遗漏了一些非常明显的东西,但我似乎在任何地方都找不到简单的教程或解释。我只使用 IIS 6。

非常感谢。

【问题讨论】:

    标签: asp.net compression gzip westwind


    【解决方案1】:

    这应该像我想的那样工作

    Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "scripts", ResolveUrl("~/js/all_script.js"));
    

    或其他方法

    HtmlGenericControl Include = new HtmlGenericControl("script"); 
    Include.Attributes.Add("type", "text/javascript"); 
    Include.Attributes.Add("src", sInclude); 
    this.Page.Header.Controls.Add(Include);
    

    希望对你有帮助

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多