Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove QueryString Variable in c#

Tags:

c#

asp.net

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 and after that i want my address to look like this:

(www.websiteName.com) .

"root location".

any help...

thanks.

like image 514
Samih A Avatar asked Dec 04 '25 13:12

Samih A


1 Answers

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.

like image 159
sshow Avatar answered Dec 06 '25 02:12

sshow



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!