开发者

Remove QueryString Variable in c#

I am very beginner With Programming...(unfortunately)

I want to remove Any added QueryString To Address after i get the variables. for example:

www.websiteName.com/page.aspx?a=344&b=233

i will get a and b a开发者_如何学运维nd after that i want my address to look like this:

(www.websiteName.com) .

"root location".

any help...

thanks.


var queryString = Request.QueryString;
// Handle querystring, then redirect to root
Response.Redirect("~/");
Response.End();

You will have to reload the page. When changing the URL, you are making another request to the server.


I wrote a blog on retrieving the URL of an ASP.Net application. Simply add the page name after the result.

This blog describes how to manipulate the query string to redirect to the same page with different (or no) parameters.


Why not just use

Request.UserHostName
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜