URL重写导致javascript问题

时间:2014-03-13 16:35:46

标签: c# asp.net url-rewriting

当我在web.config中应用以下规则进行URL重写时,单击事件不会在表单中具有字段验证器的链接按钮上触发。删除以下代码后,一切正常。我有什么想法可以让这个工作吗?单击链接按钮时出现的错误是 - JavaScript运行时错误:' WebForm_DoPostBackWithOptions'未定义

<rules>
    <rule name="Rewrite Rule 1 for StaticRewrites" stopProcessing="true">
      <match url=".*"/>
      <conditions>
        <add input="{StaticRewrites:{REQUEST_URI}}" pattern="(.+)"/>
      </conditions>
      <action type="Rewrite" url="{C:1}" appendQueryString="False"/>
    </rule>
    <rule name="Main Rule" stopProcessing="true">
      <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="index.php"/>
    </rule>
    <rule name="wordpress" patternSyntax="Wildcard">
      <match url="*"/>
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
      </conditions>
      <action type="Rewrite" url="index.php"/>
    </rule>
  </rules>

0 个答案:

没有答案