Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Is there an existing .NET method for combining querystring vars correctly?

Thread Tools

Is there an existing .NET method for combining querystring vars correctly?

Ken Fine
Posts: n/a
I am wondering if there is a build-in method in .NET for arbitrarily and
correctly combining/concatenating querystring variables into a valid

i.e. I might have the following vars I want to put into a valid querystring:

I have a user control that might sometimes be appending vars to a URL that
might have no vars:

....or might have one var:

....or might have several values...

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.


Reply With Quote
Walter Wang [MSFT]
Posts: n/a
Hi Ken,

There's no built-in function to help you achieve this but if you need to
implement it yourself, inheriting from UriBuilder should be the easiest
approach; for example:

Extended UriBuilder to get/set individual querystring items... - ASP.NET
Forums (

Walter Wang ((E-Mail Removed), remove 'online.')
Microsoft Online Community Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

This posting is provided "AS IS" with no warranties, and confers no rights.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Use self.vars in class.method(parameters, self.vars) caccolangrifata Python 18 07-22-2011 10:22 PM
Accessing URL encoded querystring vars C. ASP .Net 4 04-29-2010 02:54 PM
How do I declare global vars or class vars in Python ? Linuxguy123 Python 7 02-20-2009 06:45 PM
Create a new JSF component by combining multiple existing components Java 0 10-31-2005 10:31 PM
app vars and cache vars Jon ASP .Net 3 12-14-2004 08:52 PM