Adding master pages to solution:
A master page is similar to a ‘.aspx’ page except that it has its own unique extension, ‘.master’. Furthermore, a master page contains a new ‘Master’ directive, along with a ContentPlaceHolder control. we can keep any number of contentPlaceHolders in a single Master page.
Once you have your master page, you obviously want to create content pages using your master page as a template.
Your content page will be like any other .aspx page you have created in the past, except that it will reference the master page in the Page Directive and it will contain a Content Control and between this control will be all your content or at least the all the content for the corresponding ContentPlaceHolder contron in your master page.
<%@ Page Language=”C#” MasterPageFile=”~/Default.master” Title=”Untitled Page” %>
While adding the master page to the content bage, ‘MasterPageFile’ attribute will add with in the page directive.The use of this attribute indicates that this particular .aspx page inherits from another page.
The Location of the masterpage with in the application is specified as the value of the ‘MasterPageFile’ attribute.
After adding the Masterpage the contentpage (Default.aspx) neither contain
No comments:
Post a Comment