tags:

views:

78

answers:

2

I'm trying to get this:

www.mytest.com/form?a=123&u=123123

How can I programatically C#, get the variables in the URL?

+3  A: 
string a= Page.Request.QueryString["a"];
string u= Page.Request.QueryString["u"];
Raj Kaimal
+4  A: 

This will work no matter if the request is POST or GET

string myData = Page.Request["a"] 

If it's a POST request, the data won't go on the querystring, take this into account.

Claudio Redi
Also, Params["a"] etc. Params can be handy, albeit VERY confusing to some. I like it, my coworkers shudder. Go figure.
drachenstern