【问题标题】:URL Rewrites create compatibility issue with AjaxToolkitURL 重写创建与 AjaxToolkit 的兼容性问题
【发布时间】:2016-01-19 11:43:15
【问题描述】:

我正在使用最新的 AjaxControlToolKit v15.1.3 并使用 ...

ajaxtoolkit:calendarextender

用于在点击时弹出日历工具。
一切都很好,直到那里。现在,当我在 web.config 文件中添加 URL 重写代码时,不再出现单击弹出窗口。我需要更新的代码上的任何特定编辑才能正常工作。

这是 URL 重写代码:

<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>

【问题讨论】:

  • 很奇怪,只要显示弹出窗口不需要与服务器交互。您在浏览器控制台中看到任何错误吗?
  • @MikhailTymchuk 不,我没有遇到任何错误。无论有没有,它都能很好地呈现.....
  • 所以,我猜这个问题没有解决方案.....

标签: asp.net .htaccess url-rewriting asp.net-ajax ajaxcontroltoolkit


【解决方案1】:

众所周知,AjaxControlToolkit 不适用于 URL 重写。这是因为 AjaxControlToolkit 在运行时会生成两个扩展名为 .axd 的脚本文件:WebResource.axd 和 ScriptResource.axd。对这两个 .axd 文件的多个引用会插入到客户端 HTML 中,其中包含大量字母数字和非字母数字字符作为 URL 参数。当使用 URL 重写时,这些引用将失败。在我的情况下,and as outlined in this post,具体失败是 403(禁止)错误。该帖子中提供的解决方案对我有用,即删除所有 URL 重写。希望这也是您的选择。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-10-15
    • 2014-08-22
    • 2016-08-15
    • 2011-05-04
    • 1970-01-01
    • 2012-04-11
    • 1970-01-01
    • 2019-02-20
    相关资源
    最近更新 更多