Asp forum2.0 learning notes II - - Learn from Master Pages

xiaoxiao2021-03-06  50

The most critical issue of the ASPNET Forums interface first is that it uses MASTER PAGES controls for Metabuilders.

Until

Http://www.metabuilders.com/tools/masterpages.aspx Download this control to study:

First, Master Pages include four classes:

(1) Content: This Control Contains The Content for a Particular Region

Such controls contain real content

(2) ContentContainer: This control serves two distincts purposes: - it marks the location where the Master Page will be inserted into the Page - it contains the various Content sections that will be matched to the Master Page's Region controls (based on their ID's) .

Two intentions of this control:

· As a positioning mark, identifying the master page will be inserted into the page;

· Matches with Region Controls

(3) Nobugform: a Server Form That Does Not Cause A Problem By Being Inside a master page or other name Naming Container.

Wornless Form. Can be used with confidence

(4) Region: The Control Marks a Place Holder for Content In A Master Page

Placeholdering control

Second, we take the method of using the Master Page by analyzing Default.aspx.

(1) The content of Default.aspx is as follows:

MP: ContentContainer is a container, masterpagefile = "~ / theme / masterpage.ascx is its most important attribute, pointing to an ASCX control page. In fact, this ASCX control is not a real ASCX control, but a page frame. It provides the main structure of the Default.aspx page, then leaves a blank, let DEFAULT.ASPX fills the blank.

(2) Let's take a closer look at the content of MasterPage.ascx.

default main content


First, it has the of the HTML file, leaving a small place in , decentralizes the control, forums: PageTitle and Forums: Style

Then, there is a NobugForm in Body, which speculates first, which may refer to the FORM used for the MP control.

The most important thing is that it has one

default main content

Region is a placeholder control, who is it to occupy? See Default.aspx and understand:

see it? The ID in Content matches the ID of the Region. As a result, Default.aspx will be displayed here.

Third, the advantages are considered:

It seems that the structure of Master Pages is also relatively simple. But why do you want to use this approach instead of using the ASCX control?

The key is to skin.

ASP forums uses a special ASCX file as a framepage to achieve a convenient skin. The usual ASCX file is not possible as a frame page, which can only be part of a page, we also need an ASPX or HTML file as a frame page. If the frame page changes, all the pages that use this framework will be changed. This can be implemented using templates in Dreamweaver, but it is also quite inconvenient. (I have not used the template, I only know that it is automatically changed the page of the template but can only change a file or several files after the use of the Master Pages structure.

The benefits are a lot, of course, the shortcomings are not less possible. Unable to visualization is its biggest shortcoming now. Fourth, join the ASP.NET 2.0 connection

Today, I saw the new Master Page function in ASP.NET 2.0, which is the basically exactly the same as the forum, and seeing the control is the same source. It seems that Master Page will have a function of future will have. However, in ASP.NET 2.0, you can use the Visual Studio 2005 design function to make up a maximum shortcomings of the masterpage control.

Interested readers can take a look:

http://www.iiiedu.org.tw/taipei/student/paper/tihs9310r_doc.pdf

This PDF document is written quite detailed. And it is traditional Chinese, better than English. Ha ha

What other unfamiliaries have, we will decompose.

Next page

转载请注明原文地址:https://www.9cbs.com/read-87568.html

New Post(0)