Autumn Park QBlog resolve technical principles: Module of the page base class - lifecycle process (f)

Review article:

 

ps: Autumn Park QBlog Download: http://www.cyqdata.com/download/article-detail-427

 

From the previous section, we customize the following several life cycle page base class:

This section will give you detailed analysis Autumn Park QBlog thing in every life cycle process.

 

A: Parameter initialization: private void Page_Init (HttpContext context)

 

Autumn Park QBlog in the first life cycle, mainly to complete the following initialization parameters:

1: URL parameter receiving: i.e. the parameters passed from the sorted over UrlRewirte

2: public class: UserLogin: Such access is available to the current user information, user information to be accessed from

3: XmlHelper: Operating html document class, you can easily load html, xml way to easily operate and filled with content

4: MutilLanguage: multi-language processing class, can be unified html document translation

 

For this purpose, the base class need to define common properties, easy ashx each page handler calls.

Accordingly, the following properties are defined, and the parameter in the received:

 

There are 2 points Description Note:

1: introduction of CYQ.Data : spend two classes XmlHelper under CYQ.Data.Xml, MutilLanguage

2: UserLogin attribute is not defined and a few URL parameters: This series describes the main principles, so the details of the code skipped

 

Library Description:

XmlHelper : html mainly for loading, default constructor true, indicates loading from html

MutileLanguage : based on the extended XmlHelper allow language files loaded from xml / html in

This, the first step parameter initialization is complete.

 

II: page loads: private void Page_PreLoad ()

 

After initialization parameters via the pre-loaded html, and initial treatment, Autumn Park QBlog complete process is as follows:

1: If you open the cache: try to read the three-level cache, the page cache

2: cache does not exist: the page is loaded into the process

3: After the page loads, processing path CSS / IMG's

4: After the page loads, multi-language translation

5: The parameter determination Request.Form submitted Post is not submit data, if it is, to introduce a new Post processing flow.

 

The following is the Autumn Garden QBlog flow of the code, for reference only:

 

Description:

This phase involves the following number of key issues:

1: How to load a page?

2: How to load the language file?

3: How to deal with CSS / IMG path?

4: How unified translation?

5: OnPost trigger a new process?

These details, the next section for more detailed analysis, along this section the following analytical processes to complete.

 

Three: page-filling regions: ashx handler is responsible for the three processes

 

After initialization parameters, the page loads two processes, each ashx task handler will become simple

1:protected abstract void Page_Load()

Normal access: override this method, the content of the page is filled.

 

2:protected virtual void Page_OnCache()

Cache Access: override this method to complete individual processes, such as: user name

 

3:protected virtual void OnPost()

Commit access: override this method to submit content processing, and storage

 

IV: before output processing: private void Page_PreEnd ()

 

After> filling step is completed page, etc., - when initializing parameters -> Load Page

Before the output html page to the client,

Also we need to deal with something, and this process would be a good place to deal with these things.

 

Autumn Park QBlog here, are mainly dealt with what processes it? as follows:

1: Calculation of the article and the user access statistics

2: The title page is processed

3: cached pages


Five: page html output to the client: private void Page_End ()

 

Here the process becomes quite simple:

Output: XmlDocument.OuterXml to the client

Destruction: Dispose method is called various global variables, cancellation of individual objects.

 

Summary :

This section provides a detailed analysis of the relative Autumn Park QBlog entire life cycle of the process flow,

And it describes what each cycle to be processed.

But also left a lot of specific details, waiting for a detailed analysis and examples.

And these, in the next section for your analysis: how to load a page? And how to achieve multi-page language translation?

Reproduced in: https: //my.oschina.net/secyaher/blog/274205

Guess you like

Origin blog.csdn.net/weixin_34405354/article/details/91966789