When I get the querystring with Request.Url.Query I’d like to exclude a parameter (without using replace, or function like these).
So, for example, if I have this querystring :
?ID=1241&IDL=241&HC=1241
I’d like to exclude IDL getting :
?ID=1241&HC=1241
Is this a implemented way or I need to make my own function?
EDIT : I care about the order of my query string values.
It’s still string manipulation, but how about something like:
Alternatively you could use
Request.QueryStringto get at a processed collection of query-string parameters.EDIT: This will leave your parameters in the order they were sent.
Here’s a sample ASPX page that outputs a modified query-string (I’ve tested it in a ASP.NET 3.5 Web-Site):
NOTE:
System.Linqhas been imported. An exception will be raised if you don’t specify a query-string.