URL Rewrites create compatibility issue with AjaxToolkit

戏子无情 提交于 2020-01-17 04:49:28

问题


I'm using the latest AjaxControlToolKit v15.1.3 and using the ...

ajaxtoolkit:calendarextender

for popping up the calender tool on click.
everything works fine enough till there. now, when i add the URL rewrite code on the web.config file, the pop up on click no longer happens. any specific edit on the code i need to update for both to work.

Here is the URL rewrite code:

<rewrite>
  <rules>
    <rule name="RewriteASPX">
      <match url="(.*)" />
      <conditions logicalGrouping="MatchAll">
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
      </conditions>
      <action type="Rewrite" url="{R:1}.aspx" />
    </rule>
  </rules>
</rewrite>

回答1:


AjaxControlToolkit is known to not work with URL rewrites. This is because the AjaxControlToolkit generates two script files with .axd extensions at runtime: WebResource.axd and ScriptResource.axd. Several references to those two .axd files get inserted in your client side HTML with huge strings of alphanumeric and non-alphanumeric characters as URL parameters. Those references will fail when URL rewrites are used. In my case, and as outlined in this post, the specific failure is a 403 (Forbidden) error. The solution provided in that post worked for me, which was to remove all URL rewrites. Hopefully that's an option for you too.



来源:https://stackoverflow.com/questions/33243017/url-rewrites-create-compatibility-issue-with-ajaxtoolkit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!