Templates provided on the main webpage. Other webpages are on your website.
Main webpage
The primary web page allows you to create consistent appearances and actions for all web pages (or a group of pages) on your network.
The main webpage provides templates for other webpages to share the layout and functions. The content defined by the placeholder of the main web page, which can be overturned on the content web page. The output result is the content of the main webpage.
The content of the webpage must be displayed.
When a user requests a content webpage, ASP. NET will combine the webpage outputs to deploy the content of the main webpage and the content of the webpage.
The main webpage is as follows:
<%@ Master %>
The top of the main webpage is a normal HTML webpage designed as a template for other webpages.
@ Master's instruction definition is used as the master webpage.
The main webpage contains a placeholder tag <asp: ContentPlaceHolder> for individual content.
The ID = "CPH1" attribute of determines the reserved location, so that many places are placed on the same master page.
The name of the master page is "master1.master"
Note: The main webpage can also contain code that allows dynamic content.
Content webpage example:
<%@ Page MasterPageFile="master1.master" %><asp:ContentContentPlaceHolderId="CPH1" runat="server">The webpage content is more than one personal webpage content.
The @ Page command is defined as a standard content webpage.
The Content of the webpage contains the Content tag <asp: Content> and reference master webpage (ContentPlaceHolderId = "CPH1 ").
The content of this webpage is saved as "mypage1.aspx"
When a user requests a webpage, ASP. NET merges the webpage content with the primary webpage.
Click to display mypage1.aspx.
Note: The text Content must be marked in <asp: Content>. NO content is a flag other than permitted.
Webpage content control:
<%@ Page MasterPageFile="master1.master" %>
&br<asp:Content
ContentPlaceHolderId="CPH1" runat="server">
<form runat="server">
<asp:TextBox id="textbox1" runat="server" />
<asp:Button id="button1" runat="server" text="Button" />
</form>
</asp:Content>