我使用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不变吗?该如何实现?

解决方案 »

  1.   

     
    <add name ="NewParmter" virtualUrl ="^~/News/(\w+)/default.html$"//(\w+)你的参数
    rewriteUrlParameter="ExcludeFromClientQueryString"
    destinationUrl="~/News/Default.aspx?id=$1"//实际(\w+)你的参数是$1
    />
     
      

  2.   

    use Server.Transfer instead of Response.RedirectServer.Transfer maintains the original URL in the browser.
      

  3.   

    我的配置文件<?xml version="1.0" encoding="utf-8"?><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&amp;rsv=$4" />
        </rewriter>

    </configuration>
      

  4.   

    晕,加不了颜色<?xml version="1.0" encoding="utf-8"?>
    <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&amp;rsv=$4" />
        </rewriter>

    </configuration>
      

  5.   

    重写Page
     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);
            }
      

  6.   


    在a.aspx页面进行如下注册:
    <%@ Register TagPrefix="url" Namespace="Intelligencia.UrlRewriter" Assembly="Intelligencia.UrlRewriter" %>然后,把<asp:form runat="server">替换为url:form runat="server参考
      

  7.   

    Thanks wuyq11报错:
    无法将类型为“System.Web.UI.Design.HtmlIntrinsicControlDesigner”的对象强制转换为类型“System.Web.UI.Design.ControlDesigner”。
      

  8.   

    自从用了MVC,很久不用这个了
      

  9.   

    改用UrlRewritingNet.UrlRewriter.dll了,没有所述问题了
      

  10.   

    为什么会跳到真是的地址,点button触发了form提交,你仔细看看你的form的action就明白为什么会回去了