0% found this document useful (0 votes)
60 views2 pages

Unit - 5

Master pages in ASP.NET allow for consistent layout across pages by defining common static elements and content placeholders. A master page establishes standard page structure and behavior that child content pages can use. When a content page is requested, its content merges with the master page to produce the final output. The master page defines placeholders like ContentPlaceHolder that indicate regions content pages can populate with specific text or markup. This allows master pages to standardize site navigation, headers, footers, and other shared components while content pages focus on unique content within the defined placeholders.

Uploaded by

Patel Dhruval
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views2 pages

Unit - 5

Master pages in ASP.NET allow for consistent layout across pages by defining common static elements and content placeholders. A master page establishes standard page structure and behavior that child content pages can use. When a content page is requested, its content merges with the master page to produce the final output. The master page defines placeholders like ContentPlaceHolder that indicate regions content pages can populate with specific text or markup. This allows master pages to standardize site navigation, headers, footers, and other shared components while content pages focus on unique content within the defined placeholders.

Uploaded by

Patel Dhruval
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Unit 5 - Master Pages & Themes

1.What is Master page?


 ASP.NET master pages allow you to create a consistent layout for the pages in your
application.
 Single master page defines the look and feel and standard behavior that you want for all
of the pages (or a group of pages) in your application.
 You can then create individual content pages that contain the content you want to
display.
 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.
 A master page defines both the static page layout and the regions that can be edited by 
the ASP.NET pages that use the master page. 

2. what are the requirements of master page?


 The master pages can be used to accomplish the following:
 Creating a set of controls that are common across all the web pages and attaching them
to all the web pages.
 A centralized way to change the above created set of controls which will effectively
change all the web pages.
 Dynamically changing the common UI elements on master page from content pages
based on user preferences

Page 1
3.Explain Master Page in brief. Or Explain Content place holder in master page.
 ASP.NET master pages allow you to create a consistent layout for the pages in your
application.
 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.
 A master page defines both the static page layout and the regions that can be edited by 
the ASP.NET pages that use  the master page. 
 These content editable regions are indicated by ContentPlaceHolder control, which can 
be seen within the content <div>
 Our master page has a single ContentPlaceHolder (MainContent), but master page's 
may have multiple ContentPlaceHolders.
 The @ Master directive defines it as a master page.
The master page contains a placeholder tag for individual content.
 The id attribute identifies the placeholder, allowing many placeholders in the same
master page.
 The master page can also contain code, allowing dynamic content.
 <%@ Master Language="VB" AutoEventWireup="true" 
CodeFile="Site.master.vb" Inherits="Site" %> 
 <asp:contentplaceholder id="MainContent"  runat="server"> 
 In Content Page,
 @Page directive there's a reference to the master page file used (MasterPageFile="~/
Site.master"), and 
the ASP.NET page's markup contains a Content control for each of the ContentPlaceHold
er controls defined in the 
master page, with the control's ContentPlaceHolderID mapping the Content control to a 
specific  ContentPlaceHolder. 
 Content control is where you place the markup you want to appear in the corresponding 
ContentPlaceHolder. 
 <%@ Page Language="VB" MasterPageFile="~/Site.master" 
AutoEventWireup="true" CodeFile="Default.aspx.vb" 
Inherits="_Default" Title="Untitled Page" %> 
 <asp:Content ID="Content1" ContentPlaceHolderID="MainContent" 
Runat="Server"> 
//content
</asp:Content> 

Page 2

You might also like