ASP. NET Summary

Source: Internet
Author: User
Tags session id

asp

Asp. NET is part of the. NET Framework, a Microsoft technology, a server-side scripting technology that enables scripts in embedded Web pages to be executed by Internet servers, which can then be dynamically created on the Web server when requesting documents over HTTP. Refers to the Active Server Pages (Dynamic Servers page), which runs in the IIS (Internet Information Server service, which is a Windows-developed Web server) program.

Operating principle

1. Customer Request Web page
2.web Service Search instruction file (. aspx)
3.asp.net code is sent to the common language runtime when it is compiled
4.HTML stream back to browser and instructions
5. The browser processes the HTML and displays the page

Object

Asp. NET of several large objects together to summarize

The Response object is used to dynamically respond to client referrals, control the information sent to the user, and dynamically generate responses.
The Request object is primarily for the server to get some data from the client browser, including parameters, cookies, and user authentication passed from the HTML table with the post or get method alone.

Application Object The use of real network development is to record the entire network of information, such as the number of people on the line, online list, opinion survey and online election. Share information among many users of a given application and persist data for the duration of the server run.

Session Object used to store the information that is required for a particular user session from the beginning of a user's access to a particular ASPX page, until the user leaves. The variables of the session object are not cleared when the user switches the application's page.

The server object provides access to the methods and properties on the server. Its class name is HttpServerUtility.

Control

The beginning of the study of ASP. NET is the use of the control. I thought that the ASPNET was a change to the control. Later found not. It was later discovered that all controls are in ASP. With these controls, some of the usual tasks are made very simple. such as the submission of forms, client authentication, distribution system and site configuration, and so on.

control can be a DIME server control and HTML control

HTML server controls We know HTML tags, such as <input type= "text"/> is a label for a text box, which is called an HTML control in ASP. Asp. NET does not handle this kind of control, nor can we use it in the way that the control was previously used. Of course we can turn it into an HTML server control. The code for the converted HTML space is <input id= "Text1" type= "text" runat= "server"/> We see that it adds an ID to the properties and runat= "Server" properties. This allows you to programmatically access and control the control. Any HTML control, plus the runat= "Server" property, can be converted to a server control.

can also be divided into user controls and user-defined controls

User controls enable developers to easily define and write controls based on the needs of the application. The programming techniques used for development will be the same as the programming techniques for writing Web forms, as long as the developer modifies the control to make changes to all the controls that use the control's pages. Includes validation controls for various list controls, etc.

Custom controls, unlike user controls, are implemented by the user themselves, and define properties, methods, and events that are common to all server controls, most importantly including methods and events that control the execution life of the control, and common attributes such as IDs.


other

Session and Cookie

The 1cookie mechanism uses a scenario that maintains state on the client, while the session mechanism uses a scenario that maintains state on the server side.

The contents of 2cookie mainly include: name, value, expiration time, path and domain. The path together with the domain constitutes the scope of the cookie.

If you do not set an expiration time, this indicates that the the lifetime of a cookie is a browser session, and the cookie disappears when you close the browser window.

Session mechanism. The session mechanism is a server-side mechanism that uses a hash-like structure (or perhaps a hash table) to hold information.

When a program needs to create a session for a client's request, the server first checks to see if the client's request contains a session ID, and if it is included, it has previously created a session for this client. The server retrieves the session according to its identity. This session ID will be returned to the client in this response to be saved. This identity can be saved in a cookie-like manner, so that the browser can automatically send this identity to the server in the process of interaction.


Summarize
Overall, in the ASPNET, we learned the use of objects, the application of various controls, but also try to use these things in a comprehensive implementation of small examples. In the future study, continue to deepen, welcome guidance.

ASP. NET Summary

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.