使用自定义 httpmodule 并具有“Sys”;是未定义的错误
我创建了自己的自定义 httpmodule 来处理 url 重写,以便像 www.contoso.com/help/default.aspx
这样的 url 将指向 www.contoso.com/default.aspx
code> 实际资源所在的位置。
这工作正常,但由于我实现了 httpmodule,我遇到了 ScriptResource.axd 无法正确运行以添加执行按钮单击或 ajax 提供的功能所需的 javascript 的问题。
我将 IIS7 设置为使用经典管道应用程序池。我还确保 web.config 文件中包含必要的信息。
我已将此信息粘贴在下面。有人可以找出我遗漏或应该以不同方式配置的内容吗?
<httpHandlers>
<remove verb="*" path="*.asmx" />
<remove path="WebResource.axd" verb="GET" />
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
<add verb="*" path="*.aspx" type="myHandler" />
<add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="myModule" type="myModule" />
</httpModules>
I have created my own custom httpmodule to handle url rewriting so that urls like www.contoso.com/help/default.aspx
will point to www.contoso.com/default.aspx
where the actual resource is located.
This works fine, but because of my implementation of an httpmodule I am having problems with ScriptResource.axd not being run properly to add the javascript needed to perform button clicks or functionality afforded by ajax.
I have IIS7 set to use the classic pipeline app pool. I have also ensured that the web.config file has the necessary information in it.
I have pasted this information below. Can someone identify something that I have missed or should have configured differently?
<httpHandlers>
<remove verb="*" path="*.asmx" />
<remove path="WebResource.axd" verb="GET" />
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
<add verb="*" path="*.aspx" type="myHandler" />
<add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="myModule" type="myModule" />
</httpModules>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试将类似的内容添加到您的自定义 httpmodule 中:
Try adding something like this to your custom httpmodule: