I'm just wondering, is there a way to get the GET
parameters and POST
parameters in just one function or Collection
in ASP.NET? Like using $_REQUEST
in PHP? I'm using VB.NET.
Request["VariableName"]
(in C#) and Request("VariableName")
(in VB) should work.
See HttpRequest.Item
indexer :
Name-value pairs are returned in the following order:
- Query-string parameters.
- Form fields.
- Cookies.
- Server variables.
If the specified key is not found, then
null
is returned.
Note:
Request["xyz"]
gets it from cookies, querystring, form, or server variables
Request.Parameters["xyz"]
does the same
Request.QueryString["xyz"]
is just the querystring
Request.Form["xyz"]
is just the form
Sure is: Request.QueryString
for GET, Request.Form
for POST. You can specify a name to extract, ie Request.QueryString("id")
, to get the "id" from the URL.
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.