Presentation is loading. Please wait.

Presentation is loading. Please wait.

Unit 5: Building Presentation Layer Applications with ASP.NET 2.0.

Similar presentations


Presentation on theme: "Unit 5: Building Presentation Layer Applications with ASP.NET 2.0."— Presentation transcript:

1 Unit 5: Building Presentation Layer Applications with ASP.NET 2.0

2 Overview Data Source Controls Retrieving Relational Data Data Binding with Relational Data Retrieving XML Data Demonstration: RAD Data Binding in ASP.NET 2.0 Master Pages Site Navigation Themes Membership and Role Management ASP.NET Web Site Administration Tool Lab 5A: RAD Data Binding in ASP.NET 2.0 Lab 5B: Programming Master Pages, Site Navigation, and Themes Lab 5C: Membership and Role Management in ASP.NET 2.0 Lab Discussion

3 Data Source Controls ASP.NET Page SqlDataSource XmlDataSource Data Bound Control RDBMS XML File SiteMapDataSource AccessDataSource ObjectDataSource Business Object Site Map Access Database

4 Retrieving Relational Data To use a SqlDataSource control: Add a SqlDataSource control to a page 1 1 Specify the return type 3 3 Configure caching 4 4 Configure the SqlDataSource control 2 2

5 Data Binding with Relational Data Binding a GridView Control Sorting and Paging Enabling Data Modifications Displaying Master-Details Data

6 Retrieving XML Data Retrieving XML Data with an XmlDataSource Control: DataFile: The XML file containing the data SchemaFile: An XML schema for the data TransformFile: An XSLT stylesheet XPath: An XPath expression to filter the data DataFile: The XML file containing the data SchemaFile: An XML schema for the data TransformFile: An XSLT stylesheet XPath: An XPath expression to filter the data Binding XML Data to a TreeView Control: Create explicit node bindings Set TextField and ValueField properties Create explicit node bindings Set TextField and ValueField properties

7 Demonstration: RAD Data Binding in ASP.NET 2.0 In this demonstration, you will see how to: Use the SqlDataSource and GridView controls Use the XmlDataSource control

8 Master Pages Master pages:  Use the new @master directive  Specify standard page layout and content for a set of content pages  Contain named regions (content placeholders) where content pages can display custom content Content pages:  Identify a single master page using the MasterPageFile attribute of the @page directive  Implement content to fill content placeholders specified in master  Provide programmatic access to the controls and public members of their master page Nested master pages enable the creation of page hierarchies to modularize standard layout and content Visual Studio 2005 supports the creation and graphical editing of master and content pages

9 Site Navigation Site Map  Describes logical site structure  Stored in any type of data store for which a site map provider exists Site Map Provider  Follows “Provider Pattern” (must extend SiteMapProvider class)  Provides link between Site Map and SiteMap object model  XML provider uses Web.sitemap file (standard/default SiteMapDataProvider) SiteMap object model (SiteMap and SiteMapNode classes)  Uses replaceable provider to access Site Map data  Provides run-time access to navigation data for SiteMapPath and SiteMapDataSource controls, as well as custom controls and programs SiteMapDataSource control provides bridge between SiteMap and standard data-bindable controls  Tree controls – TreeView (new), Menu (new), …  Flat controls – ListBox, BulletedListBox (new), …

10 Themes Skin Collection of property values that define the visual appearance of a specific type of control e.g. Button, Calendar, or GridView Defined using standard ASP.NET control syntax but with a reduced property set Theme Named collection of skins, images, and style sheets Specified at the page level using @page directive to apply appropriate skins and styles to all controls on the page Specified at site or folder level using Web.config to affect all pages within scope Programmable at run time to offer enhanced customization and personalization capabilities

11 Membership and Role Management Membership system  Solves common credential storage problem  Replaces complex authentication code  Functionality packaged in server controls User Management  Validate credentials  Create, Delete, Update Role Management  Create, Delete, Update  IsUserInRole / Roles for User

12 ASP.NET Web Site Administration Tool

13 Lab 5A: RAD Data Binding with ASP.NET 2.0 Exercise 1: Creating a Stock Monitoring Web Application Exercise 2: Adding Interactivity to the Web Application Exercise 3: Creating a Details View Exercise 4: Enabling Data Updates Exercise 5: Creating a Contacts List

14 Lab 5B: Programming Master Pages, Site Navigation, and Themes Exercise 1: Creating Master and Content Pages Exercise 2: Creating Departmental Master Pages Exercise 3: Implementing Site Navigation Exercise 4: Implementing Themes and Skins

15 Lab 5C: Membership and Role Management in ASP.NET 2.0 Exercise 1: Manage User Accounts for Forms Authentication Exercise 2: Display Alternate Content to Logged-On Users Exercise 3: Add Registration and Password Management Forms to the Web Site Exercise 4: Control Access to Content by Using Roles


Download ppt "Unit 5: Building Presentation Layer Applications with ASP.NET 2.0."

Similar presentations


Ads by Google