urlrewriter issue: Query string is duplicated show

2019-04-15 06:24发布

I'm using urlRewritingNet. My web.config is here>>

<add name="HOME" virtualUrl="^~/(.*)/Default.aspx" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/Default.aspx?PageTitle=$1" ignoreCase="true"/>

My query string is here:

www.domain.com/home/default.aspx

This works. But I'm insert LoginStatus control. When click on the login control to logout, Page url was like this www.domain.com/home/default.aspx?PageTitle=home

Request.Querystring["PageTitle"] result is home,home

How to stop this duplicated query string?

1条回答
相关推荐>>
2楼-- · 2019-04-15 07:15

I came across the same problem, I did something like following;

change your destinationUrl to "~/Default.aspx/$1"

and catch it with Request.PathInfo.Substring(1);

查看更多
登录 后发表回答