Request object
The Request object is used to retrieve the Request information sent from the browser to the server. It provides access to the current page request, including the title, Cookie, client certificate, and so on. It also corresponds to the HTTP request message.
Common attributes of the Request object
Attribute |
|
ApplicationPath |
Obtain the root directory path of the ASP. NET Virtual application on the server. |
Browser |
Obtain or set the function information about the requested client browser. |
ContertLength |
Specify the length of the content sent by the client |
Cookies |
Obtain the Cookie set sent by the client |
FilePath |
Obtain the virtual path of the current request |
Files |
Obtains a set of files uploaded by the client in multi-part MIME format. |
Form |
Get the form variable set |
Item |
Obtains the specified object From the Cookies, From, QueryString, or ServerVariables set. |
Params |
Obtain a combination of QueryString, Form, ServerVariables, and Coockies. |
Path |
Obtain the virtual path of the current request |
QueryString |
Obtains the string variable set for HTTP query. |
UserHostAddress |
Obtain the IP address of the remote client host |
UserHostName |
Obtain the DNS name of a remote client |
Common Request Methods
Method |
|
MapPath |
Map the virtual path in the request URL to the physical path on the server |
SaceAs |
Save HTTP request to disk |
1. Get the value transferred between pages
2. Obtain client browser Information
You can use the Browser attribute of the Request object to access the HttpBrowserCapabilities attribute to obtain the type of Browser that is currently in use to browse the Web page, and whether the Browser supports certain functions.
The following shows the effect of the HttpBrowserCapabilities attribute experiment. The code for creating a Browser. aspx page is as follows:
The running effect is as follows:
Firefox: IE:
For more information about the Request, see here!