Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to take all querystring pairs and init a dictionary

Tags:

c#

asp.net

I want to store all the key/value pairs in my querystring:

www.example.com/?a=2&b=3&c=34

into a dictionary. Is there a quick way of doing this w/o having to manually cycle through all the items?

like image 336
Blankman Avatar asked Feb 01 '10 20:02

Blankman


1 Answers

Try HttpUtility.ParseQueryString().

It gives you back a NameValueCollection of your keys and values.

like image 64
womp Avatar answered Sep 29 '22 21:09

womp