The main page provides templates for other pages on your site.
Main Page
The main page allows you to create consistent look and behavior for all pages (or a set of pages) in your network application.
The main page provides templates for other pages, shared layouts and features. The main page placeholder defines the content that it can overturn on the content page. The output is combined with the main page, the content of the Web page.
The content of the Web page contains content to display.
When the user requests the content page, ASP. NET will combine the page output with the layout of the main page content, the content of the page.
Main Page For example:
<%@ Master%>
Above the main page is a normal HTML page design as a template for other pages.
@ Master's instruction definition as main page.
The main page contains a placeholder tag <asp:ContentPlaceHolder> individual content.
The id = "CPH1" attribute determines the reservation location so that many of the placeholders are on the same main page.
This main page is saved with the name "Master1.master"
Note: The main page can also contain code to allow dynamic content.
Content pages for example:
<%@ Page masterpagefile= "Master1.master"%> <asp:content contentplaceholderid= "CPH1" runat= "Server" >
The content of the
page is more than one page of personal web content. The
@ Page directive is defined as a standard content Web page. The contents of the
Web page contain content tags <asp:Content> and reference main pages (ContentPlaceHolderID = "CPH1").
The content of this Web page is saved with the name "mypage1.aspx"
When the user requests the page, ASP. NET merges the content of the Web page with the main page.
Click to display mypage1.aspx.
Note: text content must be in <asp:Content> tag. No content is allowed outside of the tag.
Page 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>