Asp. Net built-in Object Request object first recognized

Source: Internet
Author: User

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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.