c# - NameValueCollection not grabbing first value of query string -


i using simple statement

namevaluecollection nvcollection = httputility.parsequerystring(querystring);

i trying grab values passed in query string. simple example of passed be

form_id=webform_client_form_4&referrer=http://myurl/webform/request-information?agent=agent&keyword=keyword&full_name=jon harding&company=rts financial - test&phone=913-555-5555

the issue having referrer full string after it. need other values. in case becauase parsequerystring splits string @ & character first value ignored in namevaluecollection

currently when try value of agent blank value, understandably.

what best method make sure grab variables? split string @ question mark , prepend ampersand string before parsequerystring. there more elegant want this?

this work least effort:

namevaluecollection nvcollection = httputility.parsequerystring(querystring.replace("?","&")); 

Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -