delete
delete

Reputation:

How can I get the POST And GET data that is passed in my ASP.Net application URL?

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?

Upvotes: 1

Views: 455

Answers (2)

Claudio Redi
Claudio Redi

Reputation: 68440

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.

Upvotes: 3

Raj Kaimal
Raj Kaimal

Reputation: 8304

string a= Page.Request.QueryString["a"];
string u= Page.Request.QueryString["u"];

Upvotes: 4

Related Questions