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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top