954,580 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Removing Query Strings

Is there any possible way to remove a query string without redirecting to another page? You see, my problem is I am using panels, when the create new button is clicked, it gives the querystring of "?JobID=New" now when I click on another button (which simply hides the current panel and makes another visible), the query string is still there. I have tried Request.QueryString.Remove and Request.QueryString.Clear but it says it is read only, is there any possible way to remove it?

Slade
Practically a Master Poster
633 posts since Mar 2004
Reputation Points: 115
Solved Threads: 7
 

I just researched a little. It's not possible :).

Slade
Practically a Master Poster
633 posts since Mar 2004
Reputation Points: 115
Solved Threads: 7
 

Hi Slade, I found this article that explains exactly what your looking for. It's written in VB.net but I rewrote it in C# if you need it:
http://www.codeproject.com/useritems/Rem_Query_String_Argument.asp

I just researched a little. It's not possible :).
stevenng
Newbie Poster
1 post since May 2006
Reputation Points: 10
Solved Threads: 0
 

Use UrlRewriting

david_bronsky
Newbie Poster
4 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 

hi Slade,
According to me URL rewriting can help in solving your problem. Just check following URL

http://forums.asp.net/p/1217523/2165532.aspx

Hope this will help you.
If problem persist feel free to share with me.
Thanks & Regards
Dilip Kumar Vishwakarma
Programmer
.Net Consulting

dilipv
Light Poster
30 posts since Feb 2008
Reputation Points: 10
Solved Threads: 4
 

Yes it is possible Slade.

You need to ask yourself, how did the querystring get there?

A URL is read only yes, so you cannot "edit" it through commands on the server.

Just think about it a bit.. you got the querystring when you submitted the form...

SheSaidImaPregy
Veteran Poster
1,080 posts since Sep 2007
Reputation Points: 43
Solved Threads: 68
 

i reaserched it and there is only one way to remove request query string ,redirect on same page without querystring

jack lion
Newbie Poster
1 post since Oct 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You