Asp.NET Page Composition. Slide 2 Lecture Overview Work with master pages and content pages.

Slides:



Advertisements
Similar presentations
Making Things Look Nice: Visual Appearance and CSS CMPT 281.
Advertisements

Web Design with Cascading Style Sheet Lan Vu. Overview Introduction to CSS Designing CSS Using Visual Studio to create CSS Using template for web design.
Cascading Style Sheets Understanding styles. The term cascading describe the capability of a local style to override a general style. CSS applies style.
11 Getting Started with ASP.NET Beginning ASP.NET 4.0 in C# 2010 Chapters 5 and 6.
Ch. 5 Web Page Design – Templates and Style Sheets Mr. Ursone.
Unit 5: Building Presentation Layer Applications with ASP.NET 2.0.
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview Introduce Visual Studio 2013 Create a first ASP.NET application.
Cascading Style Sheets. Slide 2 Lecture Overview Overview of Cascading Style Sheets (CSS) Ways to declare a CSS CSS formatting capabilities New features.
XHTML1 Tables and Lists. XHTML2 Objectives In this chapter, you will: Create basic tables Structure tables Format tables Create lists.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 3-1 of…
Best Practices for UI with ASP.NET 2.0 Jeff King Program Manager Web Platform and Tools Microsoft Corporation.
A GUIDE TO SHAREPOINT 2007 CUSTOMIZATION OPTIONS Heather Solomon, WSS MVP.
Basics of HTML.
Cascading Style Sheet. What is CSS? CSS stands for Cascading Style Sheets. CSS are a series of instruction that specify how markup elements should appear.
1 Designing & Developing Web- Based Solutions in ASP.NET Week 2 Themes & Master Pages.
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.
© 2004 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Programming the Web Using ASP.Net Chapter 2: The ASP.Net Template Dave.
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)
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
HTML and Style. Session overview Leveling-off on the basic concepts of HTML and Styles Discuss Web authoring options.
ASP.NET Web Server Controls Basic Web Server Controls.
Styling and theming Build campaigns in style. What we'll look at... How a web document is structured How HTML and CSS fit together Tools you will need.
Working with Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 5.
WRT235: Writing in Electronic Environments Basic CSS.
Css. Definition Cascading style sheet (CSS)  It is a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
Things like Textboxes, Lables, ‘n’at. ASPX page is not HTML Controls are rendered into markup that a browser can understand Some controls are rendered.
Themes and Menus: The Sudoku Example Content taken from book: “Hello, Android” by Ed Burnette Third Edition.
XML Basics A brief introduction to XML in general 1XML Basics.
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.
1 Working with ASP.NET Master Pages By huda AlSuwailem Reference: Mastering Microsoft Visual Web Developer 2005 Express Edition by John Paul Mueller.
CSCI 6962: Server-side Design and Programming Facelets and User Interface Design.
CSS Cascading Style Sheets A very brief introduction CSS, Cascading Style Sheets1.
INTRODUCTION TO HTML5 New HTML5 User Interface and Attributes.
Web Design Site Structure. Site File Structure What is a wireframe?
Basic HTML Document Structure. Slide 2 Goals (XHTML HTML5) XHTML Separate document structure and content from document formatting HTML 5 Create a formal.
11 Getting Started with ASP.NET Beginning ASP.NET in C# and VB Chapters 1 and 2.
1111 Master Pages Beginning ASP.NET in C# and VB Chapter 6.
- WE’LL LOOK AT THE POSITION PROPERTY AND HOW CSS RESOLVES CONFLICTS BETWEEN STYLING INSTRUCTIONS The position property; CSS specificity hierarchy.
STYLING WITH THEMES Active server pages (ASP.NET) 1 Chapter-5.
Rendering XML Documents ©NIITeXtensible Markup Language/Lesson 5/Slide 1 of 46 Objectives In this session, you will learn to: * Define rendering * Identify.
Cascading Style Sheets (CSS). Learning Objectives To develop an understanding of how CSS can enhance the design of a webpage To create and apply CSS styling.
Chapter 2 Creating Website with Web Forms. Objectives Understand the different project types and templates when building ASP.NET web sites. The different.
Creating Consistent Looking Websites
Framework Based Internet Applications
Validation Controls, User Controls, Master Pages
Working with ASP.NET Master Pages.
Using ASP.NET Master Pages
>> Introduction to CSS
Chapter 8 User Controls.
IS 360 Declaring CSS Styles
CX Introduction to Web Programming
ASP.NET Web Controls.
Cascading Style Sheets (CSS)
Cascading Style Sheets - Building a stylesheet
State management & Master Pages in asp.net
Cascading Style Sheets (Introduction)
Cascading Style Sheets (Introduction)
Building ASP.NET Applications 2
Web Development Using ASP .NET
Web Design and Development
Master Pages & Themes.
MASTER PAGES.
Cascading Style Sheets - Building a stylesheet
Active server pages (ASP.NET)
ASP.NET 2.0 Overview Created By: Ajay Bahoriya.
Server Controls Validation Controls
Framework Based Internet Applications Styles, Themes, and Master Pages
Presentation transcript:

Asp.NET Page Composition

Slide 2 Lecture Overview Work with master pages and content pages

Slide 3 User Controls It’s possible to create user controls These are really just custom ASPNET controls created from other controls They are powerful but complex to implement Master and content pages were introduced in ASP.NET 2.0 and provide the preferred way to theme an application

Slide 4 The Purpose of Master and Content Pages They allow you to theme an application to provide a consistent look and feel Master pages typically contain An application’s menu system Default content Placeholders for content pages Content pages typically contain

Slide 5 Master Pages (Implementing) A master page is a special form ASP.NET Web page The page is typically named Master.master It’s really a special form of user control directive marks a page as a Master Page Master pages can be nested The element describes placeholders for content pages

Slide 6 directive Designate a page as a master page Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs"

Slide 7 The ContentPlaceHolder Container It’s a container placed in the master pages Content pages appear in these placeholders It’s possible to have many placeholders Set the ID property to reference the placeholder from a container Example

Slide 8 Content Pages (Creating) In directive, set the MasterPageFile to the name of the master page Create the Content element as the root element Don’t create the usual and elements These actually exist in the master page

Slide 9 MasterPageFile Attribute (Example) Make this page a content page by setting the MasterPageFile Page Language="C#" AutoEventWireup="true" CodeFile="ManageRoles.aspx.cs" MasterPageFile="~/MasterPage.master" Inherits="ManageRoles" %>

Slide 10 The Content Control The Content control (element) appear as the root element in a content page The ContentPlaceHolderID attribute references the placeholder on the master page The placeholder must exist on the master page

Slide 11 The Content Control (Example) The placeholder on the master page is named ContentPlaceholder1 <asp:Content ID="Content2" ContentPlaceHolderID= "ContentPlaceholder1" runat="Server"> From here, it's just a Web form.

Slide 12 How Master Pages Work Master pages are compiled into their own assembly When the user requests a content page, the master and content page are merged and rendered to the browser

Slide 13 Accessing the Master Page Programmatically A content page can reference a master page’s objects through the Page.Master property This is especially useful for working with master page menus Example to reference the TextBox named txtMasterMessage Page.Master.txtMasterMessage.Text = “Hello”;

Slide 14 Themes (Terminology) A skin is a named set of properties that can be applied to a control A skin can only apply to one type of control Multiple skins can be created though Style sheets refer to CSS A style sheet theme is just a style sheet that can be overridden A customization theme overrides style sheet themes

Slide 15 Creating Cascading Style Sheets.NET provides a good interface to create CSS classes Create a style sheet from a.NET template

Slide 16 Creating Cascading Style Sheets

Slide 17 Themes (Purpose) Like master pages they simplify the process of standardizing the look and feel of controls Many control types have built-in themes (styles)

Slide 18 Themes (Types) There are two types of themes Style sheet themes are applied when the control is first generated Style properties can be overridden Customization themes are applied after generation is complete Customization themes override style sheet themes and customization in the.aspx file

Slide 19 Applying Themes Themes are applied to a page using the following attributes of directive The Theme attribute set the customization theme The StylesheetTheme sets the stylesheet theme

Slide 20 Creating Theme Files Create a skin file You can create several skin files Create control declarations in skin files

Slide 21 Creating a Skin File Project, Add New Item

Slide 22 Creating a Skin File

Slide 23 Configuring a Skin File Skin files contain ASP.net control declarations The same declarations that appear in any.aspx page Do not set the ID attribute Only formatting properties can be set using themes

Slide 24 Skin File (Example)