Describe the Master Page.

Answer

Master pages in ASP.NET works as a template that you can reference this page in all other content pages. Master pages enable you to define the look and feel of all the pages in your site in a single location. If you have done changes in master page, then the changes will reflect in all the web pages that reference master pages. When users request the content pages, they merge with the master page to produce output that combines the layout of the master page with the content from the content page.

ContentPlaceHolder control is available only on master page. You can use more than one ContentPlaceHolder control in master page. To create regions that content pages can fill in, you need to define ContentPlaceHolder controls in master page as follows:

<asp:ContentPlaceHolder ID=”ContentPlaceHolder1” runat=”server”>

</asp:ContentPlaceHolder>

The page-specific content is then put inside a Content control that points to the relevant

ContentPlaceHolder:

<asp:Content ID=”Content1” ContentPlaceHolderID=”ContentPlaceHolder1” Runat=”Server”>
</asp:Content>


Note that the ContentPlaceHolderID attribute of the Content control points to the ContentPlaceHolder that is defined in the master page.

The master page is identified by a special @ Master directive that replaces the @ Page directive that is used for ordinary .aspx pages.

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="CareerRide.master.cs" Inherits="CareerRide" %>

All asp Questions

Ask your interview questions on asp

Write Your comment or Questions if you want the answers on asp from asp Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---