SlideShare a Scribd company logo
Ch6:creating consistent looking web sites
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
 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.


More Related Content

What's hot

SharePoint Lists and Libraries Configuration
SharePoint Lists and Libraries ConfigurationSharePoint Lists and Libraries Configuration
SharePoint Lists and Libraries Configuration
amitmathur31
 
ECM Introduction
ECM IntroductionECM Introduction
ECM Introduction
Hiep Luong
 
Sp ektron pres vn02 05-07-11
Sp ektron pres vn02 05-07-11Sp ektron pres vn02 05-07-11
Sp ektron pres vn02 05-07-11
clinton porter
 
Ch 6: Links
Ch 6: LinksCh 6: Links
Ch 6: Links
Steve Guinan
 
HYF - Class 01 - HTML And CSS
HYF - Class 01 - HTML And CSSHYF - Class 01 - HTML And CSS
HYF - Class 01 - HTML And CSS
Garima Kaila
 
SharePoint Fest Chicago Web Content Management in SharePoint 2013
SharePoint Fest Chicago   Web Content Management in SharePoint 2013SharePoint Fest Chicago   Web Content Management in SharePoint 2013
SharePoint Fest Chicago Web Content Management in SharePoint 2013
Patrick Tucker
 
Developing Branding Solutions for 2013
Developing Branding Solutions for 2013Developing Branding Solutions for 2013
Developing Branding Solutions for 2013
Thomas Daly
 
asp.net Webconfiguration
asp.net Webconfigurationasp.net Webconfiguration
asp.net Webconfiguration
Ma Kik
 
Developing Branding Solutions for 2013
Developing Branding Solutions for 2013Developing Branding Solutions for 2013
Developing Branding Solutions for 2013
Thomas Daly
 
Asp.net web page syntax overview
Asp.net web page syntax overviewAsp.net web page syntax overview
Asp.net web page syntax overviewSalam Khan
 
Chapter 12
Chapter 12Chapter 12
Sps redmond 2014 deck
Sps redmond 2014 deckSps redmond 2014 deck
Sps redmond 2014 deck
Dorinda Reyes
 
Design your first website using HTML
Design your first website using HTMLDesign your first website using HTML
Design your first website using HTML
Bunty Jain
 
SharePoint 2013 - Search Driven Publishing
SharePoint 2013 - Search Driven PublishingSharePoint 2013 - Search Driven Publishing
SharePoint 2013 - Search Driven Publishing
University of Hawai‘i at Mānoa
 
Prime faces Includeissue
Prime faces IncludeissuePrime faces Includeissue
Prime faces Includeissue
Godwin Thaya
 
How the page speed impacts your seo
How the page speed impacts your seoHow the page speed impacts your seo
How the page speed impacts your seo
Samskriti Business Solutions
 

What's hot (19)

SharePoint Lists and Libraries Configuration
SharePoint Lists and Libraries ConfigurationSharePoint Lists and Libraries Configuration
SharePoint Lists and Libraries Configuration
 
ECM Introduction
ECM IntroductionECM Introduction
ECM Introduction
 
Sp ektron pres vn02 05-07-11
Sp ektron pres vn02 05-07-11Sp ektron pres vn02 05-07-11
Sp ektron pres vn02 05-07-11
 
Ch 6: Links
Ch 6: LinksCh 6: Links
Ch 6: Links
 
HYF - Class 01 - HTML And CSS
HYF - Class 01 - HTML And CSSHYF - Class 01 - HTML And CSS
HYF - Class 01 - HTML And CSS
 
SharePoint Fest Chicago Web Content Management in SharePoint 2013
SharePoint Fest Chicago   Web Content Management in SharePoint 2013SharePoint Fest Chicago   Web Content Management in SharePoint 2013
SharePoint Fest Chicago Web Content Management in SharePoint 2013
 
Developing Branding Solutions for 2013
Developing Branding Solutions for 2013Developing Branding Solutions for 2013
Developing Branding Solutions for 2013
 
Final Presentation
Final PresentationFinal Presentation
Final Presentation
 
asp.net Webconfiguration
asp.net Webconfigurationasp.net Webconfiguration
asp.net Webconfiguration
 
Developing Branding Solutions for 2013
Developing Branding Solutions for 2013Developing Branding Solutions for 2013
Developing Branding Solutions for 2013
 
Asp.net web page syntax overview
Asp.net web page syntax overviewAsp.net web page syntax overview
Asp.net web page syntax overview
 
Chapter 12
Chapter 12Chapter 12
Chapter 12
 
SharePoint And WCM
SharePoint And WCMSharePoint And WCM
SharePoint And WCM
 
Html2
Html2Html2
Html2
 
Sps redmond 2014 deck
Sps redmond 2014 deckSps redmond 2014 deck
Sps redmond 2014 deck
 
Design your first website using HTML
Design your first website using HTMLDesign your first website using HTML
Design your first website using HTML
 
SharePoint 2013 - Search Driven Publishing
SharePoint 2013 - Search Driven PublishingSharePoint 2013 - Search Driven Publishing
SharePoint 2013 - Search Driven Publishing
 
Prime faces Includeissue
Prime faces IncludeissuePrime faces Includeissue
Prime faces Includeissue
 
How the page speed impacts your seo
How the page speed impacts your seoHow the page speed impacts your seo
How the page speed impacts your seo
 

Similar to Master pages

Master pages
Master pagesMaster pages
Master pages
teach4uin
 
masterpages 1.pptx
masterpages 1.pptxmasterpages 1.pptx
masterpages 1.pptx
SANJUSANJEEVTOPPO
 
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_csVaibhav Chavan
 
Master Pages In Asp.net
Master Pages In Asp.netMaster Pages In Asp.net
Master Pages In Asp.net
parallelminder
 
04 asp.net session05
04 asp.net session0504 asp.net session05
04 asp.net session05Mani Chaubey
 
11 asp.net session16
11 asp.net session1611 asp.net session16
11 asp.net session16
Vivek chan
 
04 asp.net session05
04 asp.net session0504 asp.net session05
04 asp.net session05Niit Care
 
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
 
Intro to OctoberCMS
Intro to OctoberCMSIntro to OctoberCMS
Intro to OctoberCMS
Kenton Spence
 
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 NavigationAlfredo 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
 
Blooming SharePoint Design
Blooming SharePoint DesignBlooming SharePoint Design
Blooming SharePoint Design
Kathy Hughes
 
3) web development
3) web development3) web development
3) web developmenttechbed
 
Share point 2013 Building Websites
Share point 2013 Building WebsitesShare point 2013 Building Websites
Share point 2013 Building Websites
Suhas R Satish
 
SharePoint Publishing 101
SharePoint Publishing 101SharePoint Publishing 101
SharePoint Publishing 101
Becky Bertram
 
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007
Chandima Kulathilake
 
SharePoint 2010 Introduction
SharePoint 2010 IntroductionSharePoint 2010 Introduction
SharePoint 2010 Introduction
Vishal Gupta
 

Similar to Master pages (20)

Master pages
Master pagesMaster pages
Master pages
 
masterpages 1.pptx
masterpages 1.pptxmasterpages 1.pptx
masterpages 1.pptx
 
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
 
Aspnet master pages_tutorial_10_cs
Aspnet master pages_tutorial_10_csAspnet master pages_tutorial_10_cs
Aspnet master pages_tutorial_10_cs
 
Master Pages In Asp.net
Master Pages In Asp.netMaster Pages In Asp.net
Master Pages In Asp.net
 
04 asp.net session05
04 asp.net session0504 asp.net session05
04 asp.net session05
 
11 asp.net session16
11 asp.net session1611 asp.net session16
11 asp.net session16
 
04 asp.net session05
04 asp.net session0504 asp.net session05
04 asp.net session05
 
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
 
Lecture11
Lecture11Lecture11
Lecture11
 
Intro to OctoberCMS
Intro to OctoberCMSIntro to OctoberCMS
Intro to OctoberCMS
 
Advanced SharePoint 2013 Site Administration
Advanced SharePoint 2013 Site AdministrationAdvanced SharePoint 2013 Site Administration
Advanced SharePoint 2013 Site Administration
 
Master Pages And Navigation
Master Pages And NavigationMaster Pages And Navigation
Master Pages And Navigation
 
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
 
Blooming SharePoint Design
Blooming SharePoint DesignBlooming SharePoint Design
Blooming SharePoint Design
 
3) web development
3) web development3) web development
3) web development
 
Share point 2013 Building Websites
Share point 2013 Building WebsitesShare point 2013 Building Websites
Share point 2013 Building Websites
 
SharePoint Publishing 101
SharePoint Publishing 101SharePoint Publishing 101
SharePoint Publishing 101
 
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007
 
SharePoint 2010 Introduction
SharePoint 2010 IntroductionSharePoint 2010 Introduction
SharePoint 2010 Introduction
 

More from Paneliya Prince

140120107044 ins ala.ppt
140120107044 ins ala.ppt140120107044 ins ala.ppt
140120107044 ins ala.ppt
Paneliya Prince
 
To create a web service
To create a web serviceTo create a web service
To create a web service
Paneliya Prince
 
Session and state management
Session and state managementSession and state management
Session and state management
Paneliya Prince
 
Managing states
Managing statesManaging states
Managing states
Paneliya Prince
 
Introduction to ado.net
Introduction to ado.netIntroduction to ado.net
Introduction to ado.net
Paneliya Prince
 
Grid view control
Grid view controlGrid view control
Grid view control
Paneliya Prince
 
Asp.net validation
Asp.net validationAsp.net validation
Asp.net validation
Paneliya Prince
 
Asp.net control
Asp.net controlAsp.net control
Asp.net control
Paneliya Prince
 
Wt oep visiting card
Wt oep visiting cardWt oep visiting card
Wt oep visiting card
Paneliya Prince
 
SE OEP online car service booking
SE OEP online car service bookingSE OEP online car service booking
SE OEP online car service booking
Paneliya Prince
 
creating jdbc connection
creating jdbc connectioncreating jdbc connection
creating jdbc connection
Paneliya Prince
 
processing control input
processing control inputprocessing control input
processing control input
Paneliya Prince
 
static dictionary technique
static dictionary techniquestatic dictionary technique
static dictionary technique
Paneliya Prince
 
Ajava oep shopping application
Ajava oep shopping applicationAjava oep shopping application
Ajava oep shopping application
Paneliya Prince
 
creating jdbc connection
creating jdbc connectioncreating jdbc connection
creating jdbc connection
Paneliya Prince
 
static dictionary
static dictionarystatic dictionary
static dictionary
Paneliya Prince
 
ADO.net control
ADO.net controlADO.net control
ADO.net control
Paneliya Prince
 

More from Paneliya Prince (20)

140120107044 ins ala.ppt
140120107044 ins ala.ppt140120107044 ins ala.ppt
140120107044 ins ala.ppt
 
To create a web service
To create a web serviceTo create a web service
To create a web service
 
Session and state management
Session and state managementSession and state management
Session and state management
 
Master page
Master pageMaster page
Master page
 
Managing states
Managing statesManaging states
Managing states
 
Introduction to ado.net
Introduction to ado.netIntroduction to ado.net
Introduction to ado.net
 
Grid view control
Grid view controlGrid view control
Grid view control
 
Asp.net validation
Asp.net validationAsp.net validation
Asp.net validation
 
Asp.net control
Asp.net controlAsp.net control
Asp.net control
 
Wt oep visiting card
Wt oep visiting cardWt oep visiting card
Wt oep visiting card
 
SE OEP online car service booking
SE OEP online car service bookingSE OEP online car service booking
SE OEP online car service booking
 
creating jdbc connection
creating jdbc connectioncreating jdbc connection
creating jdbc connection
 
processing control input
processing control inputprocessing control input
processing control input
 
static dictionary technique
static dictionary techniquestatic dictionary technique
static dictionary technique
 
Ajava oep
Ajava oep Ajava oep
Ajava oep
 
Ajava oep shopping application
Ajava oep shopping applicationAjava oep shopping application
Ajava oep shopping application
 
creating jdbc connection
creating jdbc connectioncreating jdbc connection
creating jdbc connection
 
DCDR
DCDRDCDR
DCDR
 
static dictionary
static dictionarystatic dictionary
static dictionary
 
ADO.net control
ADO.net controlADO.net control
ADO.net control
 

Recently uploaded

在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 

Recently uploaded (20)

在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 

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.
  • 7.
  • 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

  1. 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.
  2. Master pages defines a combination of fixed content and contentPlace holders which are filled by individual web pages.
  3. 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 <asp:TextBox runat="server" Font-Names="Verdana" Font-Size="11px" Width="200px" BorderStyle="Solid" BorderColor="#cc6666" BackColor="#ffcccc" /> 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.