What is Master Page? Give ASP.Net code to demonstrate the usage of nested master page
Master Page Code : <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs"
Inherits="MasterPage" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <asp:ContentPlaceHolder id="head" runat="server"></asp:ContentPlaceHolder> </head> <body> <form id="form1" runat="server"> <div id="header"> <h1>Master Page </h1> </div> <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder> </form> </body> </html>
Nested Master Page Code : <%@ Master Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="childMaster.master.cs" Inherits="childemaster" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server"> <asp:Label ID="Label1" runat="server" BackColor="#666666" ForeColor="#00FF66"
BorderColor="#9933CC" BorderWidth="3px" Text="Nested Master Page Code">
</asp:Label> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder> </asp:Content>
Implementing Nested Master Page : <%@ Page Title="" Language="C#" MasterPageFile="~/childMaster.master"
AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
runat="Server">ASP.Net code to demonstrate the usage of Nested Master Page<br /> <asp:Button ID="btn1" runat="server" BackColor="#000000" Font-Italic="true"
Font-Size="Small" ForeColor="#FFFFFF" Text="Download Code" /> </asp:Content>