我使用Intelligencia.UrlRewriter.dll控件来实现Url重写,可是可以了,但是在重定向到的页面中提交时,地址栏中的地址变了,该如何不让他变呢?示例:http://www.111.com/829279429/default.aspx
我请求这个Uri时,UrlRewrite到了http://www.111.com/default.aspx?ppp=829279429
此时地址栏中的地址是http://www.111.com/829279429/default.aspx,可是当我点击页面中的提交按钮时,地址栏中的地址
就变成了http://www.111.com/default.aspx?ppp=829279429,能保持http://www.111.com/829279429/default.aspx不变吗?该如何实现?
我请求这个Uri时,UrlRewrite到了http://www.111.com/default.aspx?ppp=829279429
此时地址栏中的地址是http://www.111.com/829279429/default.aspx,可是当我点击页面中的提交按钮时,地址栏中的地址
就变成了http://www.111.com/default.aspx?ppp=829279429,能保持http://www.111.com/829279429/default.aspx不变吗?该如何实现?
<add name ="NewParmter" virtualUrl ="^~/News/(\w+)/default.html$"//(\w+)你的参数
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="~/News/Default.aspx?id=$1"//实际(\w+)你的参数是$1
/>
<configSections>
<section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter" />
</configSections>
<appSettings/>
<connectionStrings/>
<system.web>
<compilation debug="false" />
<authentication mode="Windows" />
<customErrors mode="RemoteOnly" defaultRedirect="error.aspx"></customErrors>
<globalization requestEncoding="gb2312" responseEncoding="gb2312" />
<httpModules>
<add type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" name="UrlRewriter" />
</httpModules>
</system.web>
<rewriter>
<rewrite url="~/([-_0-9a-z]+)/(default|pay)[.]aspx([?]rsv=(.*))?" to="~/pay.aspx?usrinterface=$1&rsv=$4" />
</rewriter>
</configuration>
<configuration>
<configSections>
<section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter" />
</configSections>
<appSettings/>
<connectionStrings/>
<system.web>
<compilation debug="false" />
<authentication mode="Windows" />
<customErrors mode="RemoteOnly" defaultRedirect="error.aspx"></customErrors>
<globalization requestEncoding="gb2312" responseEncoding="gb2312" />
<httpModules>
<add type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" name="UrlRewriter" />
</httpModules>
</system.web>
<rewriter>
<rewrite url="~/([-_0-9a-z]+)/(default|pay)[.]aspx([?]rsv=(.*))?" to="~/pay.aspx?usrinterface=$1&rsv=$4" />
</rewriter>
</configuration>
protected override void Render(HtmlTextWriter writer)
{
if (writer is System.Web.UI.Html32TextWriter)
{
writer = new FormFixerHtml32TextWriter(writer.InnerWriter);
}
else
{
writer = new FormFixerHtmlTextWriter(writer.InnerWriter);
} base.Render(writer);
}
在a.aspx页面进行如下注册:
<%@ Register TagPrefix="url" Namespace="Intelligencia.UrlRewriter" Assembly="Intelligencia.UrlRewriter" %>然后,把<asp:form runat="server">替换为url:form runat="server参考
无法将类型为“System.Web.UI.Design.HtmlIntrinsicControlDesigner”的对象强制转换为类型“System.Web.UI.Design.ControlDesigner”。