1111 Master Pages Beginning ASP.NET 4.5.1 in C# and VB Chapter 6.

Slides:



Advertisements
Similar presentations
HTML Basics Customizing your site using the basics of HTML.
Advertisements

Chapter 3 – Web Design Tables & Page Layout
Introduction to HTML & CSS
PRESENTER: MATTHEW DILLON E SCHOOL VIEW CMS TEACHER TRAINING.
Html: getting started HTML is hyper text markup language. It is what web browsers look at on the Internet. HTML documents should be created in a simple.
HTML Overview - Cascading Style Sheets (CSS). Before We Begin Make a copy of one of your HTML file you have previously created Make a copy of one of your.
CHAPTER 7 STYLING CONTENT WITH CASCADING STYLE SHEETS.
Chapter 3 – Designing your web pages Dr. Stephanos Mavromoustakos.
Project 8 Creating Style Sheets.
Chapter 8 Creating Style Sheets.
11 Getting Started with ASP.NET Beginning ASP.NET 4.0 in C# 2010 Chapters 5 and 6.
Asp.NET Page Composition. Slide 2 Lecture Overview Work with master pages and content pages.
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview Introduce Visual Studio 2013 Create a first ASP.NET application.
XHTML1 Tables and Lists. XHTML2 Objectives In this chapter, you will: Create basic tables Structure tables Format tables Create lists.
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
HTML Notes Chapters 1--6 Codes used in creating HTML documents are called tags. Tags are always enclosed in left ( ) angle brackets. Tags can be upper.
CSS (Cascading Style Sheets): How the web is styled Create Rules that specify how the content of an HTML Element should appear. CSS controls how your web.
11 ASP.NET Controls Beginning ASP.NET 4.0 in C# 2010 Chapter 6.
Basics of HTML.
1 Designing & Developing Web- Based Solutions in ASP.NET Week 2 Themes & Master Pages.
JavaScript & jQuery the missing manual Chapter 11
Copyright © Texas Education Agency, All rights reserved. 1 Web Technologies Website Development with Dreamweaver.
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)
Creating an Expression Web Site
Basic HTML Hyper text markup Language. Re-cap  … - The tag tells the browser that this is an HTML document The html element is the outermost element.
Web Technologies Website Development Trade & Industrial Education
Cascading Style Sheets. Defines the presentation of one or more web pages Similar to a template Can control the appearance of an entire web site giving.
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
Bare bones notes. Suggested organization for main folder. REQUIRED organization for the 115 folder.
E-Commerce: Introduction to Web Development 1 Dr. Lawrence West, Management Dept., University of Central Florida Topics What is a Web.
Website Development with Dreamweaver
Title, meta, link, script.  The title looks like:  The tag defines the title of the document in the browser toolbar.  It also: ◦ Provides a title for.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
Working with Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 5.
1 Data Bound Controls II Chapter Objectives You will be able to Use a Data Source control to get data from a SQL database and make it available.
MIS 3200 – C# (C Sharp)
Dreamweaver Edulaunch Project 1 EQ: What are the key concepts when building the first page of a web site?
Bare bones slide show. The format is text files, with.htm or.html extension. Hard returns, tabs, and extra spaces are ignored. DO NOT use spaces in file.
INTRODUCTION TO HTML5 Semantic Layout in HTML5.  The new semantic layout in HTML5 refers to a new class of elements that is designed to help you understand.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
Website Features as of January 12, Site Menu Manager Click and drag menu item management Menu item renaming.
Use CSS to Implement a Reusable Design Selecting a Dreamweaver CSS Starter Layout is the easiest way to create a page with a CSS layout You can access.
CSCI 6962: Server-side Design and Programming Master Pages.
CSE 409 – Advanced Internet Technology Today you will learn  Styles  Themes  Master Pages Themes and Master Pages.
HTML GUIDE Press F5 and then Click on the links on the left to get to the section you want Section 1: Getting Started Section 2: Moving Banner Section.
Creating Your First Web Page – Topic: Creating a wiki, blog, image blog and podcast Click Arrow - Next Slide 1.
1 © Netskills Quality Internet Training, University of Newcastle Using Style Sheets in Dreamweaver CS © Netskills, Quality Internet Training, University.
Designing a Web Page Layout Using a Professional Bitmap & Vector Graphic Editing Suite 1IT: Web Technologies – Design a Web Page Layout 2 Copyright © Texas.
Advanced Web 2012 Lecture 11 Sean Costain 2012.
11 Using CSS to Control Appearance Beginning ASP.NET in C# and VB Chapter 3.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
External Style Sheets Exploring Computer Science – Lesson 3-6.
Web Site Development - Process of planning and creating a website.
Positioning Objects with CSS and Tables
1111 Creating ASPX Controls Programatically Objectives You will be able to Dynamically add controls to a page. Dynamically alter properties of controls.
11 Getting Started with ASP.NET Beginning ASP.NET in C# and VB Chapters 1 and 2.
1111 Creating HTML Programatically Objectives You will be able to Invoke C# code on the server from an ASP.NET page. Write C# code to create HTML.
11 User Controls Beginning ASP.NET in C# and VB Chapter 8.
Building a Website: Layout Fall Overall Structure: Home Page Title Section Title Frame Picture UNCP Math Menu Content Footer Contact Information.
Creating a Web Site Creating a new Web site Defining and using folders Creating and editing Web pages Viewing pages in a Web browser.
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 5 1 Adding Shared Site Elements.
CREATING MASTER PAGES Creating a Master Page Using Master Pages Giving your site a professional look and feel Adding Master Page content to existing pages.
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
1 Chapter 15 Creating a Presentation. Practical Computer Literacy, 2 nd edition Chapter 15 2 What’s inside and on the CD? In this chapter, you will learn.
1 Company Confidential Skin a Complete DotNetNuke Website Using HTML5 and CSS3 in One Hour Amelia Marschall Partner & Creative Director.
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
Building CSS in Visual Studio Slide 2 Introduction Using the different HTML (and other) Visual Studio Editors CSS tools.
MIS 3200 – C# (C Sharp)
ASP.NET Forms.
One Set of Styles Connected to As Many Pages as You Want!!!
Presentation transcript:

1111 Master Pages Beginning ASP.NET in C# and VB Chapter 6

2222 Objectives You will be able to Use ASP.NET Master Pages to provide a consistent appearance to multiple pages of a web site. Apply page specific styles to pages that use the same master page.

Why Master Pages? A convenient way to specify common elements to multiple pages in a web site. Headers Footer Sidebars Updating a master page automatically updates all pages that use that master page. 3

Example: Employ Florida Marketplace 4 Click Search for a Job

Quick Job Search 5 Enter ASP.NET and click Search Left Nav Header Footer

Search Result 6 New content in same frame.

Job Details Page 7 New content in same frame.

Master Page Similar to a normal ASP.NET page EXCEPT Contains a placeholder to be filled in from various content pages. Can’t be requested directly. Tags along with content pages Identified as master rather than page. File name extension is.master rather than.aspx Can have multiple content placeholders Each with a unique ID 8

Content Page The page requested by browsers. Normal ASPX.NET page minus the parts provided by the master page. Identifies its master page by file name. Has tags with html to fill the placeholders in the master page. Each identifies the placeholder that it is to fill. 9

When a content page is requested Content page is merged with its master page on the server. Result processed like a normal.aspx page. Result is rendered to the browser as HTML. Let’s look at an example. 10

Master Page Example In Visual Studio, create an empty ASPX web site. Name MasterPageDemo 11

Master Page Example Master pages are normally in their own folder at the top level of the web site hierarchy. Typically called “MasterPages” Right click on MasterPageDemo in Solution Explorer and select Add > New Folder. 12

Adding a Master Pages Folder 13

Adding a Master Pages Folder 14 Rename the new folder MasterPages.

Adding a Master Pages Folder 15

Adding a Master Page Right click on MasterPages (the folder name) in Solution Explorer and select Add, then Add New Item 16

Adding a Master Page In the middle panel, scroll down and select Master Page. Set the name to Demo.master 17

Initial Master Page 18

Add Some Master Page Content Set the title to “Master Page Demo” Add some dummy content as shown on the next slide 19

Add Some Master Page Content Master Page Demo Header Goes Here Sidebar Goes Here Footer Goes Here 20

Add a Content Page 21

Initial Content Page Default.aspx is created with its MasterPageFile specified and tags corresponding to each ContentPlaceHolder in the master page. 22 Set Default.aspx as the start page in Solution Explorer.

Add Some Content 23 Press F5, or click the “Play” button, to run the app.

First Run 24

Add Some Style Click the “Stop” button, or press Shift-F5 Note that closing the browser does not stop the app. It’s still waiting for more requests until we stop it. We need style rules to display the header, footer, and sidebar correctly. Add a folder for css files. Right click on MasterPageDemo in Solution Explorer and select New Folder. 25

Folder for Stylesheets 26

Rename the New Folder “Styles” 27 Just a meaningful name. Not a keyword.

Download Styles.css 060_MasterPages/ 060_MasterPages/ File Styles.css 28 Download to the new Styles directory.

Download Styles.css 29

Add Styles.css to the Website Add Styles.css to the Styles folder in SolutionExplorer 30

Styles.css in MasterPageDemo 31 Look at Styles.css

Styles.css 32

Add Stylesheet Link Add a link to the stylesheet to the section of the master page. View the page in a browser, Experiment with window size. 33

Page with Style in Chrome 34

More Content Let’s add some more substantial content. Google “lorem ipsum” Replace “Hello, World!” in Default.aspx with a lorem ipsum paragraph. Put some more lorem ipsum into the below “Sidebar Goes Here” in Demo.master. 35

Text for MainContent 36

Text for Sidebar 37 In the master page

Page with More Content 38

More Pages Now let’s add some more pages using the same master page. Include “Next Page” and “Previous Page” links with the page content. 39

Add New Item to Web Site 40

Add New Item to Web Site 41

Set Master Page for Page2.aspx 42 Do the same for Page3.aspx

Page 2 Content Page 2 Page 2 Line 2 Page 2 Line 3 Page 2 Line 4 Page 2 Line 5 Page 2 Line 6 Page 2 Line 7 Page 2 Line 8 Page 2 Line 9 Page 2 Line 10 43

Page 3 Content Page 3 Page 3 Line 2 Page 3 Line 3 Page 3 Line 4 Page 3 Line 5 Page 3 Line 6 Page 3 Line 7 Page 3 Line 8 Page 3 Line 9 Page 3 Line 10 44

Add Links 45 Default.aspx

Page 2 Page 2 Line 2 Page 2 Line 3 Page 2 Line 4 Page 2 Line 5 Page 2 Line 6 Page 2 Line 7 Page 2 Line 8 Page 2 Line 9 Page 2 Line 10 Previous Page Next Page Page2.aspx 46

Page3.aspx 47 Try it!

First Page in Chrome 48

Page Specific Style Each page can have its own styles, in addition to those from Styles.Styles.css. Add a stylesheet link to the first Content section of the.aspx page. Let’s add page specific stylesheets for Page1 and Page2. Set different fonts for the content. 49

Add a New Item to the Styles Folder 50

Make it a Style Sheet 51 Set the Name.

Page2.css 52

Add Stylesheet Link 53 Page2.aspx

Add a Stylesheet for Page3 Follow the same steps to add a page specific stylesheet for Page3. Page3.css #MainContent { font-family: "Freestyle Script" ; font-size:x-large; } 54

Page3.aspx 55

Default.aspx 56 font-family:Arial; font-size:x-large;

Page2.aspx 57 font-family:Courier New; font-size:small;

Page3.aspx 58 font-family:"Freestyle Script"; font-size:x-large;

Summary Master pages permit us to create content that is contained in multiple pages. Typically provides a "frame" for content. Often provides style rules. Each content page can provide its own stylesheet, which can override style rules in the master page. 59