page.aspx?option - how to detect "option"

K

Kevin Blount

I've seen some sites that have URLs like this:

blahblah.com/page.aspx?option

i.e. there's no 'value' for the 'name' option. I'd like to find out how
to detect if the name' is part of the URL if there's no 'value'.

Can anyone tell me?

I can work with "?option=value&option2=value" no problem.. but I've been
trying all morning to get just "?option" to detect, without success.

Cheers and TIA

Kevin
 
K

Kevin Blount

Mark,

Thanks for the reply, but I'm not sure how you're suggesting I use that
info.

Are you thinking of "string myURL = Request.QueryString;", or is there
something else you're suggesting?

Thanks

Kevin
 
G

Guest

In this case, NameValueCollection (nvc) will not help him as he wants to
detect "?option". If it was detecting "?option=", then nvc would have helped.
In case of "?option" the array of nvc will show a length of 1, but the key
name would be null. While there may better solutions, the one proposed by
Mark Rae is the easiest to implement.

- eeraj
====
http://www.interviewboard.com
 

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

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top