SlideShare a Scribd company logo
BY-Teach4u.in
Master pages
Master page defines a combination of fixed content
and content place holder to hold the web page(.aspx)
Master Page
An ASP.NET file with a .master file extension. A
master page contains a layout that includes text,
HTML, and server controls. Instead of an “@ Page”
directive, it contains an “@ Master” directive. The
master page contains all top-level HTML elements for a
page, including <html>, <head>, and <form>. A master
page typically includes the page structure (usually an
HTML table), company name and logo, and site
navigation. To enable pages to insert content, a master
page contains one or more ContentPlaceHolder
controls. A master page inherits from the MasterPage
class.
Content Page
A content page defines the ContentPlaceHolder
controls in a master page, essentially filling in the
blanks. A content page is a standard .aspx file and is
bound to the master page using the MasterPageFile
attribute in the “@ Page” directive.
Master pages provide templates that you can use to
create consistent Web pages throughout an
application.
continued
To use master pages, first create a master page and
add layout tables and other common elements. Then
add ContentPlaceHolder controls to the master page.
To create the content pages, add standard Web forms,
select the master page check box when creating the
page, select the master page, and then add content to
the page.
Master pages
To reference public properties in a master page, add
the “@ MasterType” declaration to the content page
and reference the property using
Master.Property_Name. To reference controls in a
master page, call Master.FindControl from the content
page.
Master pages
Master pages
ASP.NET master pages allow you to create a consistent layout for the
pages in your application. A 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.
How master page works
A master page is an ASP.NET file with the extension
.master (for example, MySite.master) with a predefined
layout that can include static text, HTML elements, and
server controls. The master page is identified by a
special @ Master directive that replaces the @ Page
directive that is used for ordinary .aspx pages. The
directive looks like the following.
 <%@ Master Language="C#" CodeFile="MasterPage.master.cs"
Inherits="MasterPage" %>
Content page
You define the content for the master page's
placeholder controls by creating individual content
pages, which are ASP.NET pages (.aspx files and,
optionally, code-behind files) that are bound to a
specific master page. The binding is established in the
content page's @ Page directive by including a
MasterPageFile attribute that points to the master
page to be used. For example, a content page might
have the following @ Page directive, which binds it to
the Master1.master page.
<%@ Page Language="C#"
MasterPageFile="~/MasterPages/Master1.master" Title="Content
Page"%>
Replaceable content placeholder control
 These placeholder controls define regions where replaceable content will appear.
 <%@ Master Language="C#" %>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" >
 <head runat="server" >
 <title>Master page title</title>
 </head>
 <body>
 <form id="form1" runat="server">
 <table>
 <tr>
 <td><asp:contentplaceholder id="Main" runat="server" /></td>
 <td><asp:contentplaceholder id="Footer" runat="server" /></td>
 </tr>
 </table>
 </form>
 </body>
 </html>
Content page
Advantages of master pages
They allow you to centralize the common functionality of
your pages so that you can make updates in just one place.
They make it easy to create one set of controls and code
and apply the results to a set of pages. For example, you
can use controls on the master page to create a menu that
applies to all pages.
They give you fine-grained control over the layout of the
final page by allowing you to control how the placeholder
controls are rendered.
They provide an object model that allows you to
customize the master page from individual content pages.
Run time behaviour of the master page
At run time, master pages are handled in the following sequence:
1.Users request a page by typing the URL of the content page.
2.When the page is fetched, the @ Page directive is read. If the
directive references a master page, the master page is read as well.
If this is the first time the pages have been requested, both pages
are compiled.
3.The master page with the updated content is merged into the
control tree of the content page.
4.The content of individual Content controls is merged into the
corresponding ContentPlaceHolder control in the master page.
5.The resulting merged page is rendered to the browser
Run time behaviour of the master page
Themes and skin files
Themes are a feature similar to style sheets as they
help to supply a standard look and feel to web
controls. You can use CSS style sheets to supply styles
to HTML elements but if you wanted to use a set of
predefined styling attributes to your web controls
then you should use a Theme.

Ad

More Related Content

What's hot (20)

Javascript
JavascriptJavascript
Javascript
mussawir20
 
Java script
Java scriptJava script
Java script
Shyam Khant
 
Java script
Java scriptJava script
Java script
reddivarihareesh
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
Hitesh Santani
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
Rajkumarsoy
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
ivpol
 
JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)
WebStackAcademy
 
ASP.NET Web form
ASP.NET Web formASP.NET Web form
ASP.NET Web form
Md. Mahedee Hasan
 
javascript objects
javascript objectsjavascript objects
javascript objects
Vijay Kalyan
 
Web Servers (ppt)
Web Servers (ppt)Web Servers (ppt)
Web Servers (ppt)
webhostingguy
 
Exception Handling in JAVA
Exception Handling in JAVAException Handling in JAVA
Exception Handling in JAVA
SURIT DATTA
 
Validation Controls in asp.net
Validation Controls in asp.netValidation Controls in asp.net
Validation Controls in asp.net
Deep Patel
 
Asp.net controls
Asp.net controlsAsp.net controls
Asp.net controls
baabtra.com - No. 1 supplier of quality freshers
 
Java annotations
Java annotationsJava annotations
Java annotations
FAROOK Samath
 
Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation
Salman Memon
 
Arrays
ArraysArrays
Arrays
Faisal Aziz
 
Html forms
Html formsHtml forms
Html forms
Himanshu Pathak
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
Arulmurugan Rajaraman
 
Asp.net file types
Asp.net file typesAsp.net file types
Asp.net file types
Siddhesh Palkar
 
OOP java
OOP javaOOP java
OOP java
xball977
 

Viewers also liked (20)

Master pages ppt
Master pages pptMaster pages ppt
Master pages ppt
Iblesoft
 
Master Pages In Asp.net
Master Pages In Asp.netMaster Pages In Asp.net
Master Pages In Asp.net
parallelminder
 
Master page in ASP . NET
Master page in ASP . NETMaster page in ASP . NET
Master page in ASP . NET
baabtra.com - No. 1 supplier of quality freshers
 
Asp.Net 2.0 Presentation
Asp.Net 2.0 PresentationAsp.Net 2.0 Presentation
Asp.Net 2.0 Presentation
sasidhar
 
ASP.NET Lecture 3
ASP.NET Lecture 3ASP.NET Lecture 3
ASP.NET Lecture 3
Julie Iskander
 
ADO.NET
ADO.NETADO.NET
ADO.NET
Farzad Wadia
 
Formbased authentication in asp.net
Formbased authentication in asp.netFormbased authentication in asp.net
Formbased authentication in asp.net
parallelminder
 
Nevigation control in asp.net
Nevigation control in asp.netNevigation control in asp.net
Nevigation control in asp.net
parallelminder
 
Restoring SharePoint Frontend server
Restoring SharePoint Frontend serverRestoring SharePoint Frontend server
Restoring SharePoint Frontend server
parallelminder
 
Difference between authentication and authorization in asp.net
Difference between authentication and authorization in asp.netDifference between authentication and authorization in asp.net
Difference between authentication and authorization in asp.net
Umar Ali
 
Master page in asp.net
Master page in asp.netMaster page in asp.net
Master page in asp.net
baabtra.com - No. 1 supplier of quality freshers
 
State management
State managementState management
State management
teach4uin
 
Authentication and Authorization in Asp.Net
Authentication and Authorization in Asp.NetAuthentication and Authorization in Asp.Net
Authentication and Authorization in Asp.Net
Shivanand Arur
 
Toc(df avs nfa)avishek130650107020
Toc(df avs nfa)avishek130650107020Toc(df avs nfa)avishek130650107020
Toc(df avs nfa)avishek130650107020
Avishek Sarkar
 
JSP Custom Tags
JSP Custom TagsJSP Custom Tags
JSP Custom Tags
BG Java EE Course
 
WCF
WCFWCF
WCF
Vishwa Mohan
 
Presentación softeng agile-eu gimbernat
Presentación softeng  agile-eu gimbernatPresentación softeng  agile-eu gimbernat
Presentación softeng agile-eu gimbernat
MICProductivity
 
Windows Presentation Foundation
Windows Presentation Foundation  Windows Presentation Foundation
Windows Presentation Foundation
Deepika Chaudhary
 
Developing Multi-tenant provider hosted apps: From Idea to Office Store
Developing Multi-tenant provider hosted apps: From Idea to Office StoreDeveloping Multi-tenant provider hosted apps: From Idea to Office Store
Developing Multi-tenant provider hosted apps: From Idea to Office Store
Biserka Cvetkovska
 
EUGM15 - Zoltán Simon (Printnet): Drug Profile Matching - Drug Discovery by P...
EUGM15 - Zoltán Simon (Printnet): Drug Profile Matching - Drug Discovery by P...EUGM15 - Zoltán Simon (Printnet): Drug Profile Matching - Drug Discovery by P...
EUGM15 - Zoltán Simon (Printnet): Drug Profile Matching - Drug Discovery by P...
ChemAxon
 
Master pages ppt
Master pages pptMaster pages ppt
Master pages ppt
Iblesoft
 
Master Pages In Asp.net
Master Pages In Asp.netMaster Pages In Asp.net
Master Pages In Asp.net
parallelminder
 
Asp.Net 2.0 Presentation
Asp.Net 2.0 PresentationAsp.Net 2.0 Presentation
Asp.Net 2.0 Presentation
sasidhar
 
Formbased authentication in asp.net
Formbased authentication in asp.netFormbased authentication in asp.net
Formbased authentication in asp.net
parallelminder
 
Nevigation control in asp.net
Nevigation control in asp.netNevigation control in asp.net
Nevigation control in asp.net
parallelminder
 
Restoring SharePoint Frontend server
Restoring SharePoint Frontend serverRestoring SharePoint Frontend server
Restoring SharePoint Frontend server
parallelminder
 
Difference between authentication and authorization in asp.net
Difference between authentication and authorization in asp.netDifference between authentication and authorization in asp.net
Difference between authentication and authorization in asp.net
Umar Ali
 
State management
State managementState management
State management
teach4uin
 
Authentication and Authorization in Asp.Net
Authentication and Authorization in Asp.NetAuthentication and Authorization in Asp.Net
Authentication and Authorization in Asp.Net
Shivanand Arur
 
Toc(df avs nfa)avishek130650107020
Toc(df avs nfa)avishek130650107020Toc(df avs nfa)avishek130650107020
Toc(df avs nfa)avishek130650107020
Avishek Sarkar
 
Presentación softeng agile-eu gimbernat
Presentación softeng  agile-eu gimbernatPresentación softeng  agile-eu gimbernat
Presentación softeng agile-eu gimbernat
MICProductivity
 
Windows Presentation Foundation
Windows Presentation Foundation  Windows Presentation Foundation
Windows Presentation Foundation
Deepika Chaudhary
 
Developing Multi-tenant provider hosted apps: From Idea to Office Store
Developing Multi-tenant provider hosted apps: From Idea to Office StoreDeveloping Multi-tenant provider hosted apps: From Idea to Office Store
Developing Multi-tenant provider hosted apps: From Idea to Office Store
Biserka Cvetkovska
 
EUGM15 - Zoltán Simon (Printnet): Drug Profile Matching - Drug Discovery by P...
EUGM15 - Zoltán Simon (Printnet): Drug Profile Matching - Drug Discovery by P...EUGM15 - Zoltán Simon (Printnet): Drug Profile Matching - Drug Discovery by P...
EUGM15 - Zoltán Simon (Printnet): Drug Profile Matching - Drug Discovery by P...
ChemAxon
 
Ad

Similar to Master pages (20)

Master pages
Master pagesMaster pages
Master pages
Paneliya Prince
 
masterpages 1.pptx
masterpages 1.pptxmasterpages 1.pptx
masterpages 1.pptx
SANJUSANJEEVTOPPO
 
Master page
Master pageMaster page
Master page
Bhavesh Parmar
 
ASP.NET 06 - Customizing Your Sites Appearance
ASP.NET 06 - Customizing Your Sites AppearanceASP.NET 06 - Customizing Your Sites Appearance
ASP.NET 06 - Customizing Your Sites Appearance
Randy Connolly
 
04 asp.net session05
04 asp.net session0504 asp.net session05
04 asp.net session05
Vivek Singh Chandel
 
Aspnet master pages_tutorial_10_cs
Aspnet master pages_tutorial_10_csAspnet master pages_tutorial_10_cs
Aspnet master pages_tutorial_10_cs
Vaibhav Chavan
 
Chapter 5 (master page)
Chapter 5 (master page)Chapter 5 (master page)
Chapter 5 (master page)
let's go to study
 
Chapter 12
Chapter 12Chapter 12
Chapter 12
application developer
 
11 asp.net session16
11 asp.net session1611 asp.net session16
11 asp.net session16
Vivek Singh Chandel
 
04 asp.net session05
04 asp.net session0504 asp.net session05
04 asp.net session05
Mani Chaubey
 
Customizing the Appearance and HTML Output of Visualforce Pages
Customizing the Appearance and HTML Output of VisualforcePages Customizing the Appearance and HTML Output of VisualforcePages
Customizing the Appearance and HTML Output of Visualforce Pages
Mohammed Safwat Abu Kwaik
 
04 asp.net session05
04 asp.net session0504 asp.net session05
04 asp.net session05
Niit Care
 
Intro to OctoberCMS
Intro to OctoberCMSIntro to OctoberCMS
Intro to OctoberCMS
Kenton Spence
 
Lecture11
Lecture11Lecture11
Lecture11
Châu Thanh Chương
 
Asp.net web page syntax overview
Asp.net web page syntax overviewAsp.net web page syntax overview
Asp.net web page syntax overview
Salam Khan
 
Advanced SharePoint 2013 Site Administration
Advanced SharePoint 2013 Site AdministrationAdvanced SharePoint 2013 Site Administration
Advanced SharePoint 2013 Site Administration
Learning SharePoint
 
Master Pages And Navigation
Master Pages And NavigationMaster Pages And Navigation
Master Pages And Navigation
Alfredo Cancino
 
Overview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaOverview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company india
Jignesh Aakoliya
 
Links in HTML AND CSS COMPREHENSIVE STUDY
Links in HTML AND CSS COMPREHENSIVE STUDYLinks in HTML AND CSS COMPREHENSIVE STUDY
Links in HTML AND CSS COMPREHENSIVE STUDY
TAREMWABENJAMIN3
 
3) web development
3) web development3) web development
3) web development
techbed
 
ASP.NET 06 - Customizing Your Sites Appearance
ASP.NET 06 - Customizing Your Sites AppearanceASP.NET 06 - Customizing Your Sites Appearance
ASP.NET 06 - Customizing Your Sites Appearance
Randy Connolly
 
Aspnet master pages_tutorial_10_cs
Aspnet master pages_tutorial_10_csAspnet master pages_tutorial_10_cs
Aspnet master pages_tutorial_10_cs
Vaibhav Chavan
 
04 asp.net session05
04 asp.net session0504 asp.net session05
04 asp.net session05
Mani Chaubey
 
Customizing the Appearance and HTML Output of Visualforce Pages
Customizing the Appearance and HTML Output of VisualforcePages Customizing the Appearance and HTML Output of VisualforcePages
Customizing the Appearance and HTML Output of Visualforce Pages
Mohammed Safwat Abu Kwaik
 
04 asp.net session05
04 asp.net session0504 asp.net session05
04 asp.net session05
Niit Care
 
Asp.net web page syntax overview
Asp.net web page syntax overviewAsp.net web page syntax overview
Asp.net web page syntax overview
Salam Khan
 
Advanced SharePoint 2013 Site Administration
Advanced SharePoint 2013 Site AdministrationAdvanced SharePoint 2013 Site Administration
Advanced SharePoint 2013 Site Administration
Learning SharePoint
 
Master Pages And Navigation
Master Pages And NavigationMaster Pages And Navigation
Master Pages And Navigation
Alfredo Cancino
 
Overview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaOverview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company india
Jignesh Aakoliya
 
Links in HTML AND CSS COMPREHENSIVE STUDY
Links in HTML AND CSS COMPREHENSIVE STUDYLinks in HTML AND CSS COMPREHENSIVE STUDY
Links in HTML AND CSS COMPREHENSIVE STUDY
TAREMWABENJAMIN3
 
3) web development
3) web development3) web development
3) web development
techbed
 
Ad

More from teach4uin (20)

Controls
ControlsControls
Controls
teach4uin
 
validation
validationvalidation
validation
teach4uin
 
validation
validationvalidation
validation
teach4uin
 
.Net framework
.Net framework.Net framework
.Net framework
teach4uin
 
Scripting languages
Scripting languagesScripting languages
Scripting languages
teach4uin
 
Css1
Css1Css1
Css1
teach4uin
 
Code model
Code modelCode model
Code model
teach4uin
 
Asp db
Asp dbAsp db
Asp db
teach4uin
 
security configuration
security configurationsecurity configuration
security configuration
teach4uin
 
static dynamic html tags
 static dynamic html tags static dynamic html tags
static dynamic html tags
teach4uin
 
static dynamic html tags
static dynamic html tagsstatic dynamic html tags
static dynamic html tags
teach4uin
 
New microsoft office power point presentation
New microsoft office power point presentationNew microsoft office power point presentation
New microsoft office power point presentation
teach4uin
 
.Net overview
.Net overview.Net overview
.Net overview
teach4uin
 
Stdlib functions lesson
Stdlib functions lessonStdlib functions lesson
Stdlib functions lesson
teach4uin
 
enums
enumsenums
enums
teach4uin
 
memory
memorymemory
memory
teach4uin
 
array
arrayarray
array
teach4uin
 
storage clas
storage classtorage clas
storage clas
teach4uin
 
Cprogrammingprogramcontrols
CprogrammingprogramcontrolsCprogrammingprogramcontrols
Cprogrammingprogramcontrols
teach4uin
 
Cprogrammingoperator
CprogrammingoperatorCprogrammingoperator
Cprogrammingoperator
teach4uin
 
.Net framework
.Net framework.Net framework
.Net framework
teach4uin
 
Scripting languages
Scripting languagesScripting languages
Scripting languages
teach4uin
 
security configuration
security configurationsecurity configuration
security configuration
teach4uin
 
static dynamic html tags
 static dynamic html tags static dynamic html tags
static dynamic html tags
teach4uin
 
static dynamic html tags
static dynamic html tagsstatic dynamic html tags
static dynamic html tags
teach4uin
 
New microsoft office power point presentation
New microsoft office power point presentationNew microsoft office power point presentation
New microsoft office power point presentation
teach4uin
 
.Net overview
.Net overview.Net overview
.Net overview
teach4uin
 
Stdlib functions lesson
Stdlib functions lessonStdlib functions lesson
Stdlib functions lesson
teach4uin
 
storage clas
storage classtorage clas
storage clas
teach4uin
 
Cprogrammingprogramcontrols
CprogrammingprogramcontrolsCprogrammingprogramcontrols
Cprogrammingprogramcontrols
teach4uin
 
Cprogrammingoperator
CprogrammingoperatorCprogrammingoperator
Cprogrammingoperator
teach4uin
 

Recently uploaded (20)

Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
Unit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdfUnit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdf
KanchanPatil34
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
Unit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdfUnit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdf
KanchanPatil34
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 

Master pages

  • 2. Master pages Master page defines a combination of fixed content and content place holder to hold the web page(.aspx)
  • 3. Master Page An ASP.NET file with a .master file extension. A master page contains a layout that includes text, HTML, and server controls. Instead of an “@ Page” directive, it contains an “@ Master” directive. The master page contains all top-level HTML elements for a page, including <html>, <head>, and <form>. A master page typically includes the page structure (usually an HTML table), company name and logo, and site navigation. To enable pages to insert content, a master page contains one or more ContentPlaceHolder controls. A master page inherits from the MasterPage class.
  • 4. Content Page A content page defines the ContentPlaceHolder controls in a master page, essentially filling in the blanks. A content page is a standard .aspx file and is bound to the master page using the MasterPageFile attribute in the “@ Page” directive. Master pages provide templates that you can use to create consistent Web pages throughout an application.
  • 5. continued To use master pages, first create a master page and add layout tables and other common elements. Then add ContentPlaceHolder controls to the master page. To create the content pages, add standard Web forms, select the master page check box when creating the page, select the master page, and then add content to the page.
  • 6. Master pages To reference public properties in a master page, add the “@ MasterType” declaration to the content page and reference the property using Master.Property_Name. To reference controls in a master page, call Master.FindControl from the content page.
  • 8. Master pages ASP.NET master pages allow you to create a consistent layout for the pages in your application. A 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.
  • 9. How master page works A master page is an ASP.NET file with the extension .master (for example, MySite.master) with a predefined layout that can include static text, HTML elements, and server controls. The master page is identified by a special @ Master directive that replaces the @ Page directive that is used for ordinary .aspx pages. The directive looks like the following.  <%@ Master Language="C#" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
  • 10. Content page You define the content for the master page's placeholder controls by creating individual content pages, which are ASP.NET pages (.aspx files and, optionally, code-behind files) that are bound to a specific master page. The binding is established in the content page's @ Page directive by including a MasterPageFile attribute that points to the master page to be used. For example, a content page might have the following @ Page directive, which binds it to the Master1.master page. <%@ Page Language="C#" MasterPageFile="~/MasterPages/Master1.master" Title="Content Page"%>
  • 11. Replaceable content placeholder control  These placeholder controls define regions where replaceable content will appear.  <%@ Master Language="C#" %>  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML  1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">  <html xmlns="http://www.w3.org/1999/xhtml" >  <head runat="server" >  <title>Master page title</title>  </head>  <body>  <form id="form1" runat="server">  <table>  <tr>  <td><asp:contentplaceholder id="Main" runat="server" /></td>  <td><asp:contentplaceholder id="Footer" runat="server" /></td>  </tr>  </table>  </form>  </body>  </html>
  • 13. Advantages of master pages They allow you to centralize the common functionality of your pages so that you can make updates in just one place. They make it easy to create one set of controls and code and apply the results to a set of pages. For example, you can use controls on the master page to create a menu that applies to all pages. They give you fine-grained control over the layout of the final page by allowing you to control how the placeholder controls are rendered. They provide an object model that allows you to customize the master page from individual content pages.
  • 14. Run time behaviour of the master page At run time, master pages are handled in the following sequence: 1.Users request a page by typing the URL of the content page. 2.When the page is fetched, the @ Page directive is read. If the directive references a master page, the master page is read as well. If this is the first time the pages have been requested, both pages are compiled. 3.The master page with the updated content is merged into the control tree of the content page. 4.The content of individual Content controls is merged into the corresponding ContentPlaceHolder control in the master page. 5.The resulting merged page is rendered to the browser
  • 15. Run time behaviour of the master page
  • 16. Themes and skin files Themes are a feature similar to style sheets as they help to supply a standard look and feel to web controls. You can use CSS style sheets to supply styles to HTML elements but if you wanted to use a set of predefined styling attributes to your web controls then you should use a Theme. 

Editor's Notes

  • #3: With most web sites, only part of the page changes when you go from one page to another. The parts that don’t change usually include common regions like the header, a menu, and the footer. To create web pages with a consistent layout you need a way to define these relatively static regions in a single template file.
  • #10: Master pages defines a combination of fixed content and contentPlace holders which are filled by individual web pages.
  • #17: Themes are contained in a special ASP.NET folder called App_Themes and each Theme you want to add in your web application should reside in a separate folder under this App_Themes folder. Let’s say you want to create a Theme called Dallas for the visitors that are coming from Dallas then you can create a DallasTheme folder under App_Themes folder to represent this Theme. In this folder you need to create a skin file. A skin file a file in which you describe the visual styles that are used by pages that will use this Theme. The name if the skin file is not important but the extension should be .skin. In the skin file you just need to add the exact definitions of the web controls with all the visual attributes you want. You need to add the runat=”server” attribute but beware of adding the ID attribute because that will cause an error. For example I have a skin file with the following contents &amp;lt;asp:TextBox runat=&amp;quot;server&amp;quot; Font-Names=&amp;quot;Verdana&amp;quot; Font-Size=&amp;quot;11px&amp;quot; Width=&amp;quot;200px&amp;quot; BorderStyle=&amp;quot;Solid&amp;quot; BorderColor=&amp;quot;#cc6666&amp;quot; BackColor=&amp;quot;#ffcccc&amp;quot; /&amp;gt; And this file is placed in the App_Themes/DallasTheme folder. Remember that the theme is identified by the theme folder name in this case DallasTheme. After you’ve placed the skin file you need to set a web page to use this Theme. You can enable a Theme for the entire page by setting the Theme attribute of the page equal to the name of the Theme. In this case it would be Now at every place where a Textbox web control is used, it will be rendered with the styles defined in the skin file. If you want to disable the Theme for a specific control you can set its EnableTheming property to false and it won’t get the styles from the skin file and instead you can add your own b specifying attributes. You can also define more than one style for a web control in the skin file by adding the SkinID attribute to the web control definition in the skin file and in the web page that is utilizing the Theme you can set the control’s SkinID equal to the one you want to use from the skin file.