Summary of ASP. NET knowledge points-conceptual knowledge (1)

Source: Internet
Author: User

TechnicalArticleFirst of all, we need to put it into practice. Second, we need to summarize the knowledge points of the past few days. There are not many, but few, and the contents of a quick book, along with the previous ones ------

1. Understand codebehind Mode

The specific mode is actually quite understandable. In the past, Development (just by the way, without development) often involves the implementation of the appearance and specific logic of web pages.CodeIs mixed together, it makes the entire document difficult and messy, Asp.net solution is,. the aspx file is responsible for the architecture and event Declaration of the entire interface. CS files are responsible for the corresponding events, such as click or data binding, to facilitate maintenance and clear business logic;

2. About the layer-3 structure in project development

Not only in the development of web pages, but also in the normal CS StructureProgramThis development mode is also used. A typical three-tier structure includes the presentation layer (GUI for the Application), the business layer (basic functions of the Program ), data Layer (providing access to data); in fact, this method is also a top-down design method, the data layer is only for databases, whether it is sqlserver or Oracle, the business layer provides the advanced functions required by users. during development, the coupling degree of each layer must be low, that is, the relevance of each layer is low, which facilitates the expansion of functions and provides better flexibility, at the same time, because data is not operated directly but through the intermediate business layer, data is also protected;

3. About the Asp.net page processing process

Here I am too big. I am not very familiar with it. The specific steps are: Page initialization, page object initialization on the corresponding page, and page_init () event; load view status, return data processing, page loading, raisepostbackchanged event, return event processing, page pre-return stage, save viewstate, page return, destroy object

4. Differences in saving information using application, session, cookie, and viewstate objects

Application: used to save information shared by all users. net, this role is best for web. first, all write operations must be performed in application_start time. Second, to ensure synchronization of write operations, you must use the lock and Unlock methods, which will cause bottlenecks to the website performance;

Session: used to save the proprietary information of each user. The data of this object is stored in the server memory. The storage time is generally about 2 minutes after the user request time. Therefore, it is not suitable for storing a large amount of data, otherwise, the server's memory consumption will be too large, causing a performance bottleneck; the session must be on the web. used After configuration in config; session ["ID"] = 0000; id = session ["ID"]. tostring ();

COOKIE: only suitable for storing a small amount of non-sensitive data;

Viewstate object; never used. Never used;

Query string: The value following the URL. A large amount of data cannot be transmitted. Because the URL is displayed, the security is not very good, but there are many applications. Implementation Method: response. redirect ("XXX. aspx? Id = 1 "); the query uses the query () method of the response object or the Params attribute of the request -- resonse. Query [" ID "] Or resuest. Params [" ID "]

 

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.