asp.net Ninghua bis: asp.net built-in objects

Source: Internet
Author: User

Today I will mainly introduce the following knowledge points:

Request
Response
Server
Session
Cookie
Application
<%%>及<%=%>表达式

To be exact, ASP.net does not have built-in objects this said, JSP really put request, response these as a JSP built-in objects, here is just borrowed a JSP of the argument just. Many of the above are objects that you can use when doing asp.net development without new (there are also many, in asp.net, all pages are inherited from the System.Web.UI.Page class, which is referred to as the properties of the page class).

In the center of the web is a Web server that handles the HTTP requests of the client. Because HTTP is a stateless protocol, it does not remember the last time anyone asked for it, not actively ask the client, only when the client actively requested, the server will respond.

Request

Request encapsulates the client solicitation information. The common properties of the request are as follows:

Property name Value type Description
Applicationpath String Gets the root path of the requested resource on the site
ContentEncoding Encoding Set the encoding of the request object
Cookies HttpCookieCollection A collection of cookies sent by the client to the server
QueryString NameValueCollection Collection of query strings for the current request
Urlreferrer Uri Gets which URL the user jumps to the current page

Response

The response represents the server response object. Each time a client makes a request, the server uses a response object to process the request, and after the request is processed, the server destroys the corresponding object so that it can continue to accept other customer service requests.

Response Common properties are as follows:

Property name Value type Description
Charset String Represents the character set used by the output stream
ContentEncoding Encoding Set the encoding of the output stream
ContentLength Int byte size of output stream
ContentType String HTTP MIME type of output stream
Cookies HttpCookieCollection A collection of cookies sent by the server to the client
Output TextWriter The character output stream of the server response object
Redirectlocation String REDIRECT the current request

Response Common methods

Property name return value type Description
AppendCookie void Adds a cookie to the cookie collection of the Response object
Clear void Empty all content output in the buffer
Close void Close the current server to the client connection
End void Terminates the response and sends the output from the buffer to the client
Redirect void REDIRECT Current request

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.