开发者

PostBack Url in Rewriting Url using UrlRewriting.Net

Please help me a bit code. When i using UrlRewriting.Net to Rewrite URL in my app it works fine but i got this error:

<asp:LinkButton ID="LinkButton1" runat="server"
 PostBackUrl="Product/1/book.aspx">Item 1</asp:LinkButton>

the url is: http://localhost/Product/1/book.aspx and when i click back to home page the url is like this: http://localhost/**Product/1**/Home.aspx

this is my web.config

<configuration>
<configSections>
<section name="rewriter"
requirePermission="false"
type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler,  Intelligencia.UrlRewriter" />
</configSections>
...................
<system.web>
<httpModules>
  <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule,  Intelligencia.UrlRewriter" />
</httpModules>
.....
 </system.web>

<rewriter>
<rewrite url="~/Home.aspx" to="~/vi/Default.aspx"/>
<rewrite url="~/Product/(.*)/(.*).aspx" to="~/ProductsPage.aspx?catID=$1开发者_如何学JAVA&amp;title=$2"/>
</rewriter>
</configuration>

Thanks.......


Not sure why you have the ASPX in the URI any more. The idea behind routing is you take a friendly URI:

 http://localhost/Product/1

And the routing engine routes to book.aspx. The fact your URI looks like:

http://localhost/Product/1/book.aspx 

indicates you are not routing properly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜