ASP Forum2.0 Learning Notes II---Learn about the Master Pages library
Source: Internet
Author: User
The most critical problem with the ASPNET forums interface is that it uses the Metabuilders Master Pages control.
Download this control at http://www.metabuilders.com/Tools/MasterPages.aspx to study:
One, Master pages include four classes:
(1) Content:this control contains the content for a particular region
This type of control contains real content
(2) Contentcontainer:this control serves two distincts purposes:-It marks the location where the Master Page would be insert Ed into the page-it contains the various Content sections that'll be matched to the Master Page ' s Region controls (BAS Ed on their ID ' s).
This control has two intents:
• As a locator flag, the identity master page will be inserted into the page;
• Match with region controls
(3) Nobugform:a server form that is does not cause a problem by being inside a master page or other naming.
No error form. Can be assured to use
(4) Region:the control marks a place holder to content in a master page
Placeholder controls
Second, we analyze the default.aspx to see how the master page is used
(1) The contents of the Default.aspx are as follows:
<mp:contentcontainer runat= "Server" id= "Mpcontainer" masterpagefile= "~/themes/masterpage.ascx" >
<mp:content id= "Headtag" runat= "Server" >
<meta http-equiv= "Refresh" content= "/>"
</mp:Content>
<mp:content id= "maincontent" runat= "Server" >
<forums:forumgroupview runat= "Server"/>
</mp:Content>
</mp:ContentContainer>
Mp:contentcontainer is a container, masterpagefile= "~/themes/masterpage.ascx is its most important attribute, pointing to an Ascx control page." In fact, this ascx control is not a true ascx control, but rather a page frame. It provides the main structure of the Default.aspx page, and then leaves a blank space for Default.aspx to fill in the blanks.
(2) Take a closer look at the contents of Masterpage.ascx
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