SlideShare ist ein Scribd-Unternehmen logo
1 von 18
Developing Web Applications Using ASP.NET
In this session, you will learn to:
Describe the concept of a master page
Describe the concept of a content page
Describe nested master pages
Design master pages
Configure content pages
Design nested master pages
Objectives
Developing Web Applications Using ASP.NET
Master pages:
Are ASP.NET files similar to ASP.NET Web Forms.
Define consistent, reusable layouts, code, and content that is
typically used by more than one Web page in a Web
application.
Have a file extension of .master.
Contain the @Master directive.
Do not represent complete Web pages. The content and
functionality is incorporated with other Web pages on the same
Web site at run time.
What Are Master Pages?
Developing Web Applications Using ASP.NET
Advantages of using master pages:
Allow centralization of the common functionality of Web pages.
Make it easy to create one set of controls and code and apply
the results to a set of pages.
Provide fine-grained control over the layout of Web pages.
Allow customization of master page from the individual content
pages.
What Are Master Pages? (Contd.)
Developing Web Applications Using ASP.NET
ASP.NET includes a handler that prevents master pages
from being served directly to a browser.
When a Web page references a master page, ASP.NET:
1. Fetches the requested Web page.
2. Fetches the master page referenced by the requested Web
page.
3. Merges the content from the master page with that of the
requested Web page.
4. Sends the merged results to the browser.
What Are Master Pages? (Contd.)
Developing Web Applications Using ASP.NET
Designing a Master Page:
Master page typically includes one or more
ContentPlaceHolder controls identified by their ID
attributes.
ContentPlaceholder control provides a location where
content from referencing pages will be merged at run time.
HTML markup, HTML controls, and Web server controls
(outside the ContentPlaceHolder control) can also be
added to the page.
Any server-side code can also be added to the master page.
What Are Master Pages? (Contd.)
Developing Web Applications Using ASP.NET
What Are Master Pages? (Contd.)
Content Place Holder
Control
Developing Web Applications Using ASP.NET
Content Pages:
Reference a master page for consistent layout, reusable code,
reusable content, and controls.
Enable you to create specific content that is included at run
time with the generic content from a master page.
Reference a master page by including a MasterPageFile
attribute in the @Page directive.
Contain page-specific content in Content controls. These
Content controls are merged at run time with corresponding
ContentPlaceholder controls on the referenced master
page.
What Are Content Pages?
Developing Web Applications Using ASP.NET
What Are Content Pages? (Contd.)
Page-Specific Content
Developing Web Applications Using ASP.NET
When a master page references another master page, the
referencing page is known as a child master, and the
referenced page is called the parent master.
A child master page references a parent master page by
including the MasterPageFile attribute in the @Master
directive.
A nested master page can include additional content within
its Content controls.
These Content controls correspond to
ContentPlaceHolder controls on the parent master.
Child master pages typically contain their own
ContentPlaceHolder controls that will be used by
content pages.
Nested Master Pages
Developing Web Applications Using ASP.NET
To create a nested master page, the following three files
may be created:
Parent.master: Acts as a parent master file.
Child.master: Acts as a child master file that references the
Parent.master page.
Child.aspx: Acts as a child file that references the Child.master
page .
How to Create Nested Master Pages
Developing Web Applications Using ASP.NET
Parent.master file:
<%@ Master Language="C#" %>
<HTML>
<BODY>
----------Some Tags---------
<asp:ContentPlaceHolder ID="MainContent"
runat="server“ />
----------Some Tags---------
</BODY>
</HTML>
How to Create Nested Master Pages (Contd.)
Developing Web Applications Using ASP.NET
Child.master file:
<%@ Master Language="C#“
MasterPageFile="Parent.master"%>
<asp:Content id="Content1“
ContentPlaceholderID="MainContent"
runat="server">
--------------Some Tags--------
<asp:ContentPlaceHolder ID= "ChildContent"
runat="server" />
--------------Some Tags----------
<asp:ContentPlaceHolder ID="ChildFooter“
runat="server" />
-----------Some Tags------------
</asp:Content>
How to Create Nested Master Pages (Contd.)
Developing Web Applications Using ASP.NET
Child.aspx file:
<%@ Page Language="C#“
MasterPageFile="Child.Master"%>
<asp:Content id="pageContent"
ContentPlaceholderID="ChildContent"
runat="server">
----------Some Tags---------
</asp:Content>
<asp:Content id="footerContent"
ContentPlaceholderID="ChildFooter"
runat=server>
----------Some Tags---------
</asp:Content>
How to Create Nested Master Pages (Contd.)
Developing Web Applications Using ASP.NET
Problem Statement:
You are a developer in the Adventure Works organization, a
fictitious bicycle manufacturer. You have been asked to assist
in the development of the Business-to-Consumer (B2C) Web
application and a related Business-to-Employee (B2E) extranet
portal.
Decisions on the design of the application have already been
made. You have been asked to carry out a number of specific
tasks in order to implement various elements of this design. As
part of the first phase of the B2C development, you have been
asked to implement a hierarchy of master pages that enable
commonly used user interface elements to be defined in one
place and then reused in many Web pages throughout the site.
Demo: Creating a Common Layout by Using Master Pages
Developing Web Applications Using ASP.NET
Solution:
You need to perform following tasks:
1. Design a Master Page
a. Open the Adventure Works Web site.
b. Create the TopLevel.master page.
c. Define the layout of the TopLevel.master page.
d. Write code for the TopLevel.master page.
Demo: Creating a Common Layout by Using Master Pages (Contd.)
Developing Web Applications Using ASP.NET
2. Add and Configure Content Pages
a. Add a new Contact.aspx Web page.
b. Define the layout of the new Contact.aspx Web page.
c. Add code to the Contact.aspx page.
d. Specify the master page for the existing Default.aspx Web page.
e. Programmatically access controls on the master page from the
Default.aspx content page.
f. Add preconfigured content Web pages to the Adventure Works Web
site.
Demo: Creating a Common Layout by Using Master Pages (Contd.)
Developing Web Applications Using ASP.NET
3. Design Nested Master Pages
a. Add a nested master page.
b. Design the nested master page.
c. Add content pages for the nested master page.
d. Test the Adventure Works Web site.
e. Modify the TopLevel.master page.
Demo: Creating a Common Layout by Using Master Pages (Contd.)
Developing Web Applications Using ASP.NET
In this session, you learned that:
Master pages are ASP.NET files with the .master extension.
Master pages define consistent, reusable layouts, code and
content for multiple Web pages.
Master pages are not sent to the browser directly.
Master page elements are merged with referencing Web pages
at run time.
Merged content is sent to the browser.
Content pages are Web pages that reference a master page.
Content pages include their own page-specific content that is
merged with the master page at run time.
A master page can reference another master page.
Summary

Weitere ähnliche Inhalte

Was ist angesagt?

Developing Branding Solutions for 2013
Developing Branding Solutions for 2013Developing Branding Solutions for 2013
Developing Branding Solutions for 2013Thomas Daly
 
Chris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien - Introduction to the SharePoint Framework for developersChris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien - Introduction to the SharePoint Framework for developersChris O'Brien
 
Rails v3.2 Basic Introduction
Rails v3.2 Basic IntroductionRails v3.2 Basic Introduction
Rails v3.2 Basic IntroductionPrabu D
 
Aspnet master pages_tutorial_10_cs
Aspnet master pages_tutorial_10_csAspnet master pages_tutorial_10_cs
Aspnet master pages_tutorial_10_csVaibhav Chavan
 
Active Server Page(ASP)
Active Server Page(ASP)Active Server Page(ASP)
Active Server Page(ASP)Keshab Nath
 
Share point hosted add ins munich
Share point hosted add ins munichShare point hosted add ins munich
Share point hosted add ins munichSonja Madsen
 
Gabriel Gayhart - XML Pointer File Example
Gabriel Gayhart - XML Pointer File ExampleGabriel Gayhart - XML Pointer File Example
Gabriel Gayhart - XML Pointer File Examplelinkedinsys
 
A Power User's Intro to jQuery Awesomeness in SharePoint
A Power User's Intro to jQuery Awesomeness in SharePointA Power User's Intro to jQuery Awesomeness in SharePoint
A Power User's Intro to jQuery Awesomeness in SharePointMark Rackley
 
SharePoint Saturday DFW 2015 - Build a SharePoint 2013 Search Driven Application
SharePoint Saturday DFW 2015 - Build a SharePoint 2013 Search Driven ApplicationSharePoint Saturday DFW 2015 - Build a SharePoint 2013 Search Driven Application
SharePoint Saturday DFW 2015 - Build a SharePoint 2013 Search Driven ApplicationBrian Culver
 
Sps redmond 2014 deck
Sps redmond 2014 deckSps redmond 2014 deck
Sps redmond 2014 deckDorinda Reyes
 
Using js link and display templates
Using js link and display templatesUsing js link and display templates
Using js link and display templatesPaul Hunt
 
New Features of ASP.NET 4.0
New Features of ASP.NET 4.0New Features of ASP.NET 4.0
New Features of ASP.NET 4.0Buu Nguyen
 
(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery Guide(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery GuideMark Rackley
 
Internet Sites in Microsoft Azure Using SharePoint 2013 - Solution Model
Internet Sites in Microsoft Azure Using SharePoint 2013 - Solution ModelInternet Sites in Microsoft Azure Using SharePoint 2013 - Solution Model
Internet Sites in Microsoft Azure Using SharePoint 2013 - Solution ModelDavid J Rosenthal
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Railshasan2000
 

Was ist angesagt? (20)

Developing Branding Solutions for 2013
Developing Branding Solutions for 2013Developing Branding Solutions for 2013
Developing Branding Solutions for 2013
 
Tutorial asp.net
Tutorial  asp.netTutorial  asp.net
Tutorial asp.net
 
Web forms in ASP.net
Web forms in ASP.netWeb forms in ASP.net
Web forms in ASP.net
 
Chris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien - Introduction to the SharePoint Framework for developersChris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien - Introduction to the SharePoint Framework for developers
 
Rails v3.2 Basic Introduction
Rails v3.2 Basic IntroductionRails v3.2 Basic Introduction
Rails v3.2 Basic Introduction
 
Aspnet master pages_tutorial_10_cs
Aspnet master pages_tutorial_10_csAspnet master pages_tutorial_10_cs
Aspnet master pages_tutorial_10_cs
 
Active Server Page(ASP)
Active Server Page(ASP)Active Server Page(ASP)
Active Server Page(ASP)
 
Asp.Net Tutorials
Asp.Net TutorialsAsp.Net Tutorials
Asp.Net Tutorials
 
Share point hosted add ins munich
Share point hosted add ins munichShare point hosted add ins munich
Share point hosted add ins munich
 
Gabriel Gayhart - XML Pointer File Example
Gabriel Gayhart - XML Pointer File ExampleGabriel Gayhart - XML Pointer File Example
Gabriel Gayhart - XML Pointer File Example
 
A Power User's Intro to jQuery Awesomeness in SharePoint
A Power User's Intro to jQuery Awesomeness in SharePointA Power User's Intro to jQuery Awesomeness in SharePoint
A Power User's Intro to jQuery Awesomeness in SharePoint
 
SharePoint Saturday DFW 2015 - Build a SharePoint 2013 Search Driven Application
SharePoint Saturday DFW 2015 - Build a SharePoint 2013 Search Driven ApplicationSharePoint Saturday DFW 2015 - Build a SharePoint 2013 Search Driven Application
SharePoint Saturday DFW 2015 - Build a SharePoint 2013 Search Driven Application
 
Sps redmond 2014 deck
Sps redmond 2014 deckSps redmond 2014 deck
Sps redmond 2014 deck
 
Using js link and display templates
Using js link and display templatesUsing js link and display templates
Using js link and display templates
 
New Features of ASP.NET 4.0
New Features of ASP.NET 4.0New Features of ASP.NET 4.0
New Features of ASP.NET 4.0
 
(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery Guide(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery Guide
 
Internet Sites in Microsoft Azure Using SharePoint 2013 - Solution Model
Internet Sites in Microsoft Azure Using SharePoint 2013 - Solution ModelInternet Sites in Microsoft Azure Using SharePoint 2013 - Solution Model
Internet Sites in Microsoft Azure Using SharePoint 2013 - Solution Model
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
 
Apex & jQuery Mobile
Apex & jQuery MobileApex & jQuery Mobile
Apex & jQuery Mobile
 
Chapter 12
Chapter 12Chapter 12
Chapter 12
 

Andere mochten auch

06 asp.net session08
06 asp.net session0806 asp.net session08
06 asp.net session08Vivek chan
 
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)Vivek chan
 
Cryptography Explained with Encryption SSL HASH and Digital Signature
 Cryptography Explained with Encryption SSL HASH and Digital Signature Cryptography Explained with Encryption SSL HASH and Digital Signature
Cryptography Explained with Encryption SSL HASH and Digital SignatureVivek chan
 
Tulsi ke Dohe
Tulsi ke DoheTulsi ke Dohe
Tulsi ke DohePrem Paul
 
Ram charitra manas
Ram charitra manasRam charitra manas
Ram charitra manasVishnu Soni
 
Quiz on Indian literature
Quiz on Indian literature Quiz on Indian literature
Quiz on Indian literature meetvineet
 

Andere mochten auch (6)

06 asp.net session08
06 asp.net session0806 asp.net session08
06 asp.net session08
 
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
 
Cryptography Explained with Encryption SSL HASH and Digital Signature
 Cryptography Explained with Encryption SSL HASH and Digital Signature Cryptography Explained with Encryption SSL HASH and Digital Signature
Cryptography Explained with Encryption SSL HASH and Digital Signature
 
Tulsi ke Dohe
Tulsi ke DoheTulsi ke Dohe
Tulsi ke Dohe
 
Ram charitra manas
Ram charitra manasRam charitra manas
Ram charitra manas
 
Quiz on Indian literature
Quiz on Indian literature Quiz on Indian literature
Quiz on Indian literature
 

Ähnlich wie 04 asp.net session05

Ähnlich wie 04 asp.net session05 (20)

04 asp.net session05
04 asp.net session0504 asp.net session05
04 asp.net session05
 
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
 
Master pages
Master pagesMaster pages
Master pages
 
Asp.net w3schools
Asp.net w3schoolsAsp.net w3schools
Asp.net w3schools
 
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
 
11 asp.net session16
11 asp.net session1611 asp.net session16
11 asp.net session16
 
14 asp.net session20
14 asp.net session2014 asp.net session20
14 asp.net session20
 
masterpages 1.pptx
masterpages 1.pptxmasterpages 1.pptx
masterpages 1.pptx
 
Asp.net architecture
Asp.net architectureAsp.net architecture
Asp.net architecture
 
A View about ASP .NET and their objectives
A View about ASP .NET and their objectivesA View about ASP .NET and their objectives
A View about ASP .NET and their objectives
 
16 asp.net session23
16 asp.net session2316 asp.net session23
16 asp.net session23
 
ASP.NET - Web Programming
ASP.NET - Web ProgrammingASP.NET - Web Programming
ASP.NET - Web Programming
 
Creating web form
Creating web formCreating web form
Creating web form
 
Creating web form
Creating web formCreating web form
Creating web form
 
03 asp.net session04
03 asp.net session0403 asp.net session04
03 asp.net session04
 
CMS Lessons Learned at Vassar by Megg Brown
CMS Lessons Learned at Vassar by Megg BrownCMS Lessons Learned at Vassar by Megg Brown
CMS Lessons Learned at Vassar by Megg Brown
 
Lecture11
Lecture11Lecture11
Lecture11
 
12 asp.net session17
12 asp.net session1712 asp.net session17
12 asp.net session17
 
Walkthrough asp.net
Walkthrough asp.netWalkthrough asp.net
Walkthrough asp.net
 
Chapter 5 (master page)
Chapter 5 (master page)Chapter 5 (master page)
Chapter 5 (master page)
 

Mehr von Vivek chan

Deceptive Marketing.pdf
Deceptive Marketing.pdfDeceptive Marketing.pdf
Deceptive Marketing.pdfVivek chan
 
brain controled wheel chair.pdf
brain controled wheel chair.pdfbrain controled wheel chair.pdf
brain controled wheel chair.pdfVivek chan
 
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)Vivek chan
 
Manav dharma shashtra tatha shashan paddati munshiram jigyasu
Manav dharma shashtra tatha shashan paddati   munshiram jigyasuManav dharma shashtra tatha shashan paddati   munshiram jigyasu
Manav dharma shashtra tatha shashan paddati munshiram jigyasuVivek chan
 
Self driving and connected cars fooling sensors and tracking drivers
Self driving and connected cars fooling sensors and tracking driversSelf driving and connected cars fooling sensors and tracking drivers
Self driving and connected cars fooling sensors and tracking driversVivek chan
 
EEG Acquisition Device to Control Wheelchair Using Thoughts
EEG Acquisition Device to Control Wheelchair Using ThoughtsEEG Acquisition Device to Control Wheelchair Using Thoughts
EEG Acquisition Device to Control Wheelchair Using ThoughtsVivek chan
 
Vivek Chan | Technology Consultant
Vivek Chan | Technology Consultant Vivek Chan | Technology Consultant
Vivek Chan | Technology Consultant Vivek chan
 
Vivek Chan | Technology Consultant
Vivek Chan | Technology Consultant Vivek Chan | Technology Consultant
Vivek Chan | Technology Consultant Vivek chan
 
Net framework session01
Net framework session01Net framework session01
Net framework session01Vivek chan
 
Net framework session03
Net framework session03Net framework session03
Net framework session03Vivek chan
 
Net framework session02
Net framework session02Net framework session02
Net framework session02Vivek chan
 
04 intel v_tune_session_05
04 intel v_tune_session_0504 intel v_tune_session_05
04 intel v_tune_session_05Vivek chan
 
03 intel v_tune_session_04
03 intel v_tune_session_0403 intel v_tune_session_04
03 intel v_tune_session_04Vivek chan
 
02 intel v_tune_session_02
02 intel v_tune_session_0202 intel v_tune_session_02
02 intel v_tune_session_02Vivek chan
 
01 intel v_tune_session_01
01 intel v_tune_session_0101 intel v_tune_session_01
01 intel v_tune_session_01Vivek chan
 
09 intel v_tune_session_13
09 intel v_tune_session_1309 intel v_tune_session_13
09 intel v_tune_session_13Vivek chan
 
07 intel v_tune_session_10
07 intel v_tune_session_1007 intel v_tune_session_10
07 intel v_tune_session_10Vivek chan
 
02 asp.net session02
02 asp.net session0202 asp.net session02
02 asp.net session02Vivek chan
 
01 asp.net session01
01 asp.net session0101 asp.net session01
01 asp.net session01Vivek chan
 
15 asp.net session22
15 asp.net session2215 asp.net session22
15 asp.net session22Vivek chan
 

Mehr von Vivek chan (20)

Deceptive Marketing.pdf
Deceptive Marketing.pdfDeceptive Marketing.pdf
Deceptive Marketing.pdf
 
brain controled wheel chair.pdf
brain controled wheel chair.pdfbrain controled wheel chair.pdf
brain controled wheel chair.pdf
 
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
 
Manav dharma shashtra tatha shashan paddati munshiram jigyasu
Manav dharma shashtra tatha shashan paddati   munshiram jigyasuManav dharma shashtra tatha shashan paddati   munshiram jigyasu
Manav dharma shashtra tatha shashan paddati munshiram jigyasu
 
Self driving and connected cars fooling sensors and tracking drivers
Self driving and connected cars fooling sensors and tracking driversSelf driving and connected cars fooling sensors and tracking drivers
Self driving and connected cars fooling sensors and tracking drivers
 
EEG Acquisition Device to Control Wheelchair Using Thoughts
EEG Acquisition Device to Control Wheelchair Using ThoughtsEEG Acquisition Device to Control Wheelchair Using Thoughts
EEG Acquisition Device to Control Wheelchair Using Thoughts
 
Vivek Chan | Technology Consultant
Vivek Chan | Technology Consultant Vivek Chan | Technology Consultant
Vivek Chan | Technology Consultant
 
Vivek Chan | Technology Consultant
Vivek Chan | Technology Consultant Vivek Chan | Technology Consultant
Vivek Chan | Technology Consultant
 
Net framework session01
Net framework session01Net framework session01
Net framework session01
 
Net framework session03
Net framework session03Net framework session03
Net framework session03
 
Net framework session02
Net framework session02Net framework session02
Net framework session02
 
04 intel v_tune_session_05
04 intel v_tune_session_0504 intel v_tune_session_05
04 intel v_tune_session_05
 
03 intel v_tune_session_04
03 intel v_tune_session_0403 intel v_tune_session_04
03 intel v_tune_session_04
 
02 intel v_tune_session_02
02 intel v_tune_session_0202 intel v_tune_session_02
02 intel v_tune_session_02
 
01 intel v_tune_session_01
01 intel v_tune_session_0101 intel v_tune_session_01
01 intel v_tune_session_01
 
09 intel v_tune_session_13
09 intel v_tune_session_1309 intel v_tune_session_13
09 intel v_tune_session_13
 
07 intel v_tune_session_10
07 intel v_tune_session_1007 intel v_tune_session_10
07 intel v_tune_session_10
 
02 asp.net session02
02 asp.net session0202 asp.net session02
02 asp.net session02
 
01 asp.net session01
01 asp.net session0101 asp.net session01
01 asp.net session01
 
15 asp.net session22
15 asp.net session2215 asp.net session22
15 asp.net session22
 

Kürzlich hochgeladen

Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 

Kürzlich hochgeladen (20)

Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 

04 asp.net session05

  • 1. Developing Web Applications Using ASP.NET In this session, you will learn to: Describe the concept of a master page Describe the concept of a content page Describe nested master pages Design master pages Configure content pages Design nested master pages Objectives
  • 2. Developing Web Applications Using ASP.NET Master pages: Are ASP.NET files similar to ASP.NET Web Forms. Define consistent, reusable layouts, code, and content that is typically used by more than one Web page in a Web application. Have a file extension of .master. Contain the @Master directive. Do not represent complete Web pages. The content and functionality is incorporated with other Web pages on the same Web site at run time. What Are Master Pages?
  • 3. Developing Web Applications Using ASP.NET Advantages of using master pages: Allow centralization of the common functionality of Web pages. Make it easy to create one set of controls and code and apply the results to a set of pages. Provide fine-grained control over the layout of Web pages. Allow customization of master page from the individual content pages. What Are Master Pages? (Contd.)
  • 4. Developing Web Applications Using ASP.NET ASP.NET includes a handler that prevents master pages from being served directly to a browser. When a Web page references a master page, ASP.NET: 1. Fetches the requested Web page. 2. Fetches the master page referenced by the requested Web page. 3. Merges the content from the master page with that of the requested Web page. 4. Sends the merged results to the browser. What Are Master Pages? (Contd.)
  • 5. Developing Web Applications Using ASP.NET Designing a Master Page: Master page typically includes one or more ContentPlaceHolder controls identified by their ID attributes. ContentPlaceholder control provides a location where content from referencing pages will be merged at run time. HTML markup, HTML controls, and Web server controls (outside the ContentPlaceHolder control) can also be added to the page. Any server-side code can also be added to the master page. What Are Master Pages? (Contd.)
  • 6. Developing Web Applications Using ASP.NET What Are Master Pages? (Contd.) Content Place Holder Control
  • 7. Developing Web Applications Using ASP.NET Content Pages: Reference a master page for consistent layout, reusable code, reusable content, and controls. Enable you to create specific content that is included at run time with the generic content from a master page. Reference a master page by including a MasterPageFile attribute in the @Page directive. Contain page-specific content in Content controls. These Content controls are merged at run time with corresponding ContentPlaceholder controls on the referenced master page. What Are Content Pages?
  • 8. Developing Web Applications Using ASP.NET What Are Content Pages? (Contd.) Page-Specific Content
  • 9. Developing Web Applications Using ASP.NET When a master page references another master page, the referencing page is known as a child master, and the referenced page is called the parent master. A child master page references a parent master page by including the MasterPageFile attribute in the @Master directive. A nested master page can include additional content within its Content controls. These Content controls correspond to ContentPlaceHolder controls on the parent master. Child master pages typically contain their own ContentPlaceHolder controls that will be used by content pages. Nested Master Pages
  • 10. Developing Web Applications Using ASP.NET To create a nested master page, the following three files may be created: Parent.master: Acts as a parent master file. Child.master: Acts as a child master file that references the Parent.master page. Child.aspx: Acts as a child file that references the Child.master page . How to Create Nested Master Pages
  • 11. Developing Web Applications Using ASP.NET Parent.master file: <%@ Master Language="C#" %> <HTML> <BODY> ----------Some Tags--------- <asp:ContentPlaceHolder ID="MainContent" runat="server“ /> ----------Some Tags--------- </BODY> </HTML> How to Create Nested Master Pages (Contd.)
  • 12. Developing Web Applications Using ASP.NET Child.master file: <%@ Master Language="C#“ MasterPageFile="Parent.master"%> <asp:Content id="Content1“ ContentPlaceholderID="MainContent" runat="server"> --------------Some Tags-------- <asp:ContentPlaceHolder ID= "ChildContent" runat="server" /> --------------Some Tags---------- <asp:ContentPlaceHolder ID="ChildFooter“ runat="server" /> -----------Some Tags------------ </asp:Content> How to Create Nested Master Pages (Contd.)
  • 13. Developing Web Applications Using ASP.NET Child.aspx file: <%@ Page Language="C#“ MasterPageFile="Child.Master"%> <asp:Content id="pageContent" ContentPlaceholderID="ChildContent" runat="server"> ----------Some Tags--------- </asp:Content> <asp:Content id="footerContent" ContentPlaceholderID="ChildFooter" runat=server> ----------Some Tags--------- </asp:Content> How to Create Nested Master Pages (Contd.)
  • 14. Developing Web Applications Using ASP.NET Problem Statement: You are a developer in the Adventure Works organization, a fictitious bicycle manufacturer. You have been asked to assist in the development of the Business-to-Consumer (B2C) Web application and a related Business-to-Employee (B2E) extranet portal. Decisions on the design of the application have already been made. You have been asked to carry out a number of specific tasks in order to implement various elements of this design. As part of the first phase of the B2C development, you have been asked to implement a hierarchy of master pages that enable commonly used user interface elements to be defined in one place and then reused in many Web pages throughout the site. Demo: Creating a Common Layout by Using Master Pages
  • 15. Developing Web Applications Using ASP.NET Solution: You need to perform following tasks: 1. Design a Master Page a. Open the Adventure Works Web site. b. Create the TopLevel.master page. c. Define the layout of the TopLevel.master page. d. Write code for the TopLevel.master page. Demo: Creating a Common Layout by Using Master Pages (Contd.)
  • 16. Developing Web Applications Using ASP.NET 2. Add and Configure Content Pages a. Add a new Contact.aspx Web page. b. Define the layout of the new Contact.aspx Web page. c. Add code to the Contact.aspx page. d. Specify the master page for the existing Default.aspx Web page. e. Programmatically access controls on the master page from the Default.aspx content page. f. Add preconfigured content Web pages to the Adventure Works Web site. Demo: Creating a Common Layout by Using Master Pages (Contd.)
  • 17. Developing Web Applications Using ASP.NET 3. Design Nested Master Pages a. Add a nested master page. b. Design the nested master page. c. Add content pages for the nested master page. d. Test the Adventure Works Web site. e. Modify the TopLevel.master page. Demo: Creating a Common Layout by Using Master Pages (Contd.)
  • 18. Developing Web Applications Using ASP.NET In this session, you learned that: Master pages are ASP.NET files with the .master extension. Master pages define consistent, reusable layouts, code and content for multiple Web pages. Master pages are not sent to the browser directly. Master page elements are merged with referencing Web pages at run time. Merged content is sent to the browser. Content pages are Web pages that reference a master page. Content pages include their own page-specific content that is merged with the master page at run time. A master page can reference another master page. Summary