Is there an existing .NET method for combining querystring vars correctly?
am 22.01.2008 04:22:40 von Ken FineI am wondering if there is a build-in method in .NET for arbitrarily and
correctly combining/concatenating querystring variables into a valid
querystring.
i.e. I might have the following vars I want to put into a valid querystring:
id=200
action=doStuff
I have a user control that might sometimes be appending vars to a URL that
might have no vars:
http://whatever.com/index.asp
....or might have one var:
http://whatever.com?foo=bar
....or might have several values...
http://whartever.com?foo=bar&max=200
or might have # "fragment identfiers"/anchor references mixed in.
Is there a .NET method that will tack on a new variable to a valid
querystring in the correct form, or do I need to make this myself? This is
not hard but someone else has already done the work, I'll take that.
-KF