urlrewriter issue: Query string is duplicated shown?

旧巷老猫 提交于 2019-12-09 23:25:54

问题


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:


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);



来源:https://stackoverflow.com/questions/1516151/urlrewriter-issue-query-string-is-duplicated-shown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!