Building a URL w/querystring variables

  • Thread starter Thread starter Steve Hershoff
  • Start date Start date
S

Steve Hershoff

Hi everyone,

I'm noodling over the best way to construct a URL with a new querystring
variable. Let's say I want to take my existing page's URL and append a new
variable with accompanying value, then redirect, but I don't know up front
whether the URL already has any variables defined. Is there a good way of
doing this besides testing for the presence of a "?" in the URL string?

As a cherry on top and a side note it'd be nice to know too if the variable
I'm appending is already part of the URL.

Thanks very much for your help!
 
Loop through the items in the Request.QueryString collection and test to see
if they match your criteria or if there even is any items. That should give
you what you want.
 
Back
Top