简体   繁体   中英

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?

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM