Marco Bellinaso Senior Trainer & Consultant Code Architects Srl Building Dynamic Navigation Systems with Visual Studio 2005 and ASP.NET 2.0.

Slides:



Advertisements
Similar presentations
Malek Kemmou Technology Architect, Application Platform Microsoft Middle East and Africa Overview of ASP.NET 2.0.
Advertisements

Drupal Basics Part 3 Create a new page Main tabs menu Using the theme Agricultural Communications Services Integrated Media Training Sessions
Master Pages, User Controls, Site Maps, Localization Svetlin Nakov Telerik Corporation
Internetteknologi (ITNET2) Presentation 21: ASP.NET Advanced.
Intermediate Level Course. Text Format The text styles, bold, italics, underlining, superscript and subscript, can be easily added to selected text. Text.
Unit 5: Building Presentation Layer Applications with ASP.NET 2.0.
Asp.NET Core Server Controls. Slide 2 Lecture Overview Understanding the types of ASP.NET controls HTML controls ASP.NET (Web) controls.
 2006 Pearson Education, Inc. All rights reserved Introduction to the Visual C# 2005 Express Edition IDE.
1 Chapter 12 Working With Access 2000 on the Internet.
Tutorial 16 Working with Dynamic Content and Styles.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 3-1 of…
Building ASP.NET Applications 2 Lecture 3,4 T. Ahlam Algharasi 4 th Level.
Navigation Controls MacDonald Ch. 11 MIS 424 MIS 424 Professor Sandvig Professor Sandvig.
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
1 Agenda Overview Review Roles Lists Libraries Columns.
ASP.NET Programming with C# and SQL Server First Edition
Web Forms. Agenda Web forms Web controls Code separation Dynamic compilation System.Web.UI.Page User controls.
® IBM Software Group © 2006 IBM Corporation Creating JSF/EGL Template Pages This section describes how to create.JTPL (Java Template Pages) using the Page.
1 Designing & Developing Web- Based Solutions in ASP.NET Week 3 Website Navigation & Resources.
Web Site Navigation How to get around in an ASP.NET web application 1Web Site Navigation.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
Dr. Azeddine Chikh IS444: Modern tools for applications development.
Object-Oriented Application Development Using VB.NET 1 Chapter 12 Web Forms, HTML, and ASP.NET.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Master Pages and Site Navigation Minder Chen
© Ms. Masihi.  The Dreamweaver Welcome Screen first opens when you start Dreamweaver.  This screen gives you quick access to previously opened files,
Using the Actions Pane, Host Controls, and Smart Tags
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 4-1 of…
ASP.Net, Web Forms and Web Controls 1 Outline Web Controls Text and Graphics Controls AdRotator Control Validation Controls.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
ASP.NET Web Server Controls Basic Web Server Controls.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 2 Welcome Application Introducing the Visual Basic 2008 Express Edition IDE.
ASP.NET Controls. Slide 2 Lecture Overview Identify the types of controls supported by ASP.NET and the differences between them.
ASP.NET.. ASP.NET Environment ASP.NET is Microsoft's programming framework that enables the development of Web applications and services. It is an easy.
 2009 Pearson Education, Inc. All rights reserved Introduction to the Visual Basic Express 2008 IDE.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 13 – Graphical User Interfaces Part 2 Outline.
Graphical User Interface Concepts - Part 2 Session 09 Mata kuliah: M0874 – Programming II Tahun: 2010.
Managing Look, Feel, and Layout with Visual Studio 2005 and ASP.NET 2.0.
Chapter 7 – Navigation Dr. Stephanos Mavromoustakos.
Introduction to ASP.NET T.Ahlam Algharasi. The Visual Studio IDE Start page 2.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
WaveMaker Visual AJAX Studio 4.0 Training Basics: Building Your First Application Designer Basics.
 2006 Pearson Education, Inc. All rights reserved Introduction to the Visual C# 2005 Express Edition IDE.
Role Management in.NET Shree Shalini Pusapati CS /17/20151.
Sofia, Bulgaria | 9-10 October ASP.NET: Developing Portal UI With Web Parts Goksin Bakir Yage Ltd Microsoft Regional Director, MEA Goksin Bakir Yage Ltd.
TRAINING SESSIONS.NET Controls.  Standard Controls  Label  Textbox  Checkbox  Button, Image Button, Image control  Radio Button  Literal  Hyperlink.
1 CS 3870/CS 5870: Note 19 SiteMap and AJAX Lab 8.
Microsoft ® Official Course Developing a Publishing Site for Web Content Microsoft SharePoint 2013 SharePoint Practice.
1 CS 3870/CS 5870: Note 18 SiteMap Prog8. Test 2 50 Points Thursday, Nov 12 2:00 PM – 4:00 PM Lab
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Asp.NET Core Server Controls. Slide 2 Lecture Overview Understanding the types of ASP.NET controls HTML controls ASP.NET (Web) controls.
A Lap Around New Enhancements for Web Developers in Visual Studio 2005 Alexander Holy Developer Evangelist, Microsoft EMEA
Building Custom Controls with ASP.NET and the Microsoft ®.NET Framework Rames Gantanant Microsoft Regional Director, Thailand
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
Easy Site Navigation Getting organized, staying organized Creating custom site-navigation controls Using Menu, TreeView, and SiteMenuPath controls Make.
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 5 1 Adding Shared Site Elements.
Vinod Unny Enterprise InfoTech Microsoft Regional Director, North India
Chapter 7 Navigation. Objectives How to move around in your site using server controls and plain HTML How to address pages and other resources like images.
Site Maps and Navigation
Website Navigation.
Introduction to the Visual C# 2005 Express Edition IDE
CS 3870 Prog6 Roles Management Due Monday, November 5 Group Assignment.
State management & Master Pages in asp.net
CS 3870/CS 5870 Prog 6 Site Map.
CHƯƠNG IX: SITE NAVIGATION & USER CONTROL
Building ASP.NET Applications
Module 05: Building ASP .NET Applications
Web Development Using ASP .NET
NAVIGATION CONTROLS.
Website Navigation.
Presentation transcript:

Marco Bellinaso Senior Trainer & Consultant Code Architects Srl Building Dynamic Navigation Systems with Visual Studio 2005 and ASP.NET 2.0

Agenda Navigation controls TreeView controls Menu controls Site maps XML site maps SiteMapDataSource controls SiteMapPath controls Site map API

Site Navigation Navigation UIs are tedious to implement Especially if they rely on client-side script New controls simplify site navigation TreeView and Menu - Navigation UI SiteMapDataSource - XML site maps SiteMapPath - "Bread crumb" controls Public API provides foundation for controls Provider-based for flexibility

Site Navigation Schema Site Navigation API Site Maps Web.sitemap Other Data Stores Controls Menu TreeView SiteMapPath SiteMap- DataSource SiteMap- DataSource SiteMap SiteMapNode XmlSiteMapProvider Other Site Map Providers Other Site Map Providers

TreeView Controls Render hierarchical data as trees Expandable and collapsible branches Nodes are navigable, selectable, or static and can include check boxes Content defined by TreeNode objects TreeNodes can be added declaratively, programmatically, or through data binding TreeNodes can also be demand-loaded Highly customizable UI

Declaring a TreeView <asp:TreeNode Text="Programming.NET" RunAt="server" Navigateurl="Classes.aspx?id=1" /> <asp:TreeNode Text="Programming ASP.NET" RunAt="server" NavigateUrl="Classes.aspx?id=2" /> <asp:TreeNode Text="Programming Web Services" RunAt="server" NavigateUrl="Classes.aspx?id=3" /> <asp:TreeNode Text="Consulting" RunAt="server" NavigateUrl="Consulting.aspx" /> <asp:TreeNode Text="Debugging" RunAt="server" NavigateUrl="Debugging.aspx" />

Key TreeView Properties NameDescription CheckedNodesIndicates which, if any, check boxes are checked NodesTreeNodeCollection representing tree nodes SelectedNodeTreeNode representing the node that is currently selected ShowCheckBoxesSpecifies which, if any, node types include check boxes ShowExpandCollapseSpecifies wehther expand/collapse indicators are shown ShowLinesSpecifies whether nodes are connected by lines ExpandDepthSpecifies the TreeView's initial expand depth

Key TreeView Properties, Cont. NameDescription LevelStylesSpecifies appearance of nodes by level RootNodeStyleSpecifies appearance of root nodes ImageUrl propertiesIdentify expand/collapse indicator images and others LeafNodeStyleSpecifies appearance of leaf nodes SelectedNodeStyleSpecifies appearance of selected nodes HoverNodeStyleSpecifies appearance of nodes when cursor hovers overhead NodeStyleSpecifies default appearance of nodes

Key TreeNode Properties NameDescription CheckedIndicates whether the node's check box is checked NavigateUrlURL to navigate to when node is clicked SelectActionAction to take when non-navigable node is clicked SelectedIndicates whether node is currently selected ShowCheckBoxSpecifies whether node includes a check box ImageUrlURL of image to display next to node text TextNode text

Example <asp:TreeNode Text="Click to expand or collapse" SelectAction="Expand" Runat="server"> <asp:TreeNode Text="Click to select and expand or collapse" SelectAction="SelectExpand" Runat="server"> <asp:TreeNode Text="Check box node" ShowCheckBox="true" Runat="server"> <asp:TreeNode Text="Click to navigate" NavigateUrl="..." Runat="server" />

TreeView Events NameDescription CheckChangedFired when a check box is checked or unchecked SelectedNodeChangedFired when the selected node changes TreeNodeCollapsedFired when a branch is collapsed TreeNodeExpandedFired when a branch is expanded TreeNodeDataBoundFired when a tree node binds to a data source TreeNodePopulate*Fired when a PopulateOnDemand node needs content * Only fired on server if EnableClientScript="false"

Using SelectedNodeChanged.... void OnUpdate (Object sender, EventArgs e) { // Get the text of the selected node string text = Tree.SelectedNode.Text;... }

Populating Nodes on Demand <asp:TreeView OnTreeNodePopulate="OnPopulate" EnableClientScript="false" RunAt="server"> <asp:TreeNode Text="Populate this node on demand" PopulateOnDemand="true" RunAt="server" />. void OnPopulate (Object sender, TreeNodeEventArgs e) { // Called first time the populate-on-demand node is expanded TreeNode node = new TreeNode ("This node added dynamically"); e.Node.ChildNodes.Add (node); }

Menu Controls Drop-down/fly-out menus for Web pages Items are navigable or selectable Can be oriented horizontally or vertically Content defined by MenuItem objects MenuItems can be added declaratively, programmatically, or through data binding Highly customizable UI

Declaring a Menu <asp:MenuItem Text="Programming.NET" RunAt="server" Navigateurl="Classes.aspx?id=1" /> <asp:MenuItem Text="Programming ASP.NET" RunAt="server" NavigateUrl="Classes.aspx?id=2" /> <asp:MenuItem Text="Programming Web Services" RunAt="server" NavigateUrl="Classes.aspx?id=3" /> <asp:MenuItem Text="Consulting" RunAt="server" NavigateUrl="Consulting.aspx" /> <asp:MenuItem Text="Debugging" RunAt="server" NavigateUrl="Debugging.aspx" />

Key Menu Properties NameDescription ItemsMenuItemCollection representing menu items OrientationSpecifies whether to orient menu horizontally or vertically SelectedItemMenuItem representing the item that is currently selected StaticStyle propertiesSpecify appearance of static menus DynamicStyle propertiesSpecify appearance of dynamic menus ItemWrapSpecifies whether menu item should wrap

Key MenuItem Properties NameDescription ImageUrl NavigateUrl SelectedIndicates whether the item is currently selected TextMenu item text (visible to user) ToolTipTooltip text displayed when cursor pauses over menu item ValueMenu item value (not visible to user) URL to navigate to when menu item is clicked URL of image to display next to menu item text

Menu Events NameDescription MenuItemClickFired when a menu item is clicked MenuItemDataBoundFired when a menu item binds to a data source

Using MenuItemClick.... void OnClick (Object sender, MenuEventArgs e) { // Get the text of the selected menu item string text = e.Item.Text;... }

Name Title Microsoft Corporation Menu-Driven Navigation

SiteMapDataSource Data source control representing site maps Site map = List of pages and URLs Nodes can include descriptive text Permits TreeViews and Menus to be populated with links through data binding Supports "security trimming" Specified nodes visible only to specified roles Provider-based for flexible data storage

XML Site Map <siteMapNode title="Training" url="Training.aspx" description="Training for.NET developers"> <siteMapNode title="Programming.NET" url="Classes.aspx?id=1" description="All about the.NET Framework" /> <siteMapNode title="Programming ASP.NET" url="Classes.aspx?id=2" description="All about ASP.NET" /> <siteMapNode title="Programming Web Services" url="Classes.aspx?id=3" description="All about Web services" /> <siteMapNode title="Consulting" url="Consulting.aspx" description="Consulting for.NET projects" /> <siteMapNode title="Debugging" url="Debugging.aspx" description="Help when you need it the most" />

TreeViews and Site Maps <siteMapNode title="Training" url="Training.aspx" description="Training for.NET developers"> <siteMapNode title="Programming.NET" url="Classes.aspx?id=1" description="All about the.NET Framework" /> <siteMapNode title="Programming ASP.NET" url="Classes.aspx?id=2" description="All about ASP.NET" /> <siteMapNode title="Programming Web Services" url="Classes.aspx?id=3" description="All about Web services" /> <siteMapNode title="Consulting" url="Consulting.aspx" description="Consulting for.NET projects" /> <siteMapNode title="Debugging" url="Debugging.aspx" description="Help when you need it the most" /> <siteMapNode title="Training" url="Training.aspx" description="Training for.NET developers"> <siteMapNode title="Programming.NET" url="Classes.aspx?id=1" description="All about the.NET Framework" /> <siteMapNode title="Programming ASP.NET" url="Classes.aspx?id=2" description="All about ASP.NET" /> <siteMapNode title="Programming Web Services" url="Classes.aspx?id=3" description="All about Web services" /> <siteMapNode title="Consulting" url="Consulting.aspx" description="Consulting for.NET projects" /> <siteMapNode title="Debugging" url="Debugging.aspx" description="Help when you need it the most" /> Web.sitemap

Menus and Site Maps <siteMapNode title="Training" url="Training.aspx" description="Training for.NET developers"> <siteMapNode title="Programming.NET" url="Classes.aspx?id=1" description="All about the.NET Framework" /> <siteMapNode title="Programming ASP.NET" url="Classes.aspx?id=2" description="All about ASP.NET" /> <siteMapNode title="Programming Web Services" url="Classes.aspx?id=3" description="All about Web services" /> <siteMapNode title="Consulting" url="Consulting.aspx" description="Consulting for.NET projects" /> <siteMapNode title="Debugging" url="Debugging.aspx" description="Help when you need it the most" /> <siteMapNode title="Training" url="Training.aspx" description="Training for.NET developers"> <siteMapNode title="Programming.NET" url="Classes.aspx?id=1" description="All about the.NET Framework" /> <siteMapNode title="Programming ASP.NET" url="Classes.aspx?id=2" description="All about ASP.NET" /> <siteMapNode title="Programming Web Services" url="Classes.aspx?id=3" description="All about Web services" /> <siteMapNode title="Consulting" url="Consulting.aspx" description="Consulting for.NET projects" /> <siteMapNode title="Debugging" url="Debugging.aspx" description="Help when you need it the most" /> Web.sitemap

Changing the File Name <add name="AspNetXmlSiteMapProvider" type="System.Web.XmlSiteMapProvider, System.Web,..." siteMapFile="Acme.sitemap" />

Attributes NameDescription descriptionDescription of node rolesRole or roles for which this node is visible* titleTitle of this node urlURL of this node * Multiple roles can be specified using comma- or semicolon-delimited lists

Security Trimming <siteMapNode title="Announcements" url="Announcements.aspx" description="Information for all employees" /> <siteMapNode title="Salaries" url="Salaries.aspx" description="Salary data" roles="Managers,CEOs" /> Visible only to Managers and CEOs Visible to everyone

Enabling Security Trimming <add name="AspNetXmlSiteMapProvider" type="System.Web.XmlSiteMapProvider, System.Web,..." securityTrimmingEnabled="true" siteMapFile="web.sitemap" />

SiteMapDataSource Properties NameDescription SiteMapProviderName of provider used to obtain site map data StartingNodeOffsetStarting node identified by level (default = 0) StartingNodeUrlStarting node identified by URL StartFromCurrentNodeSpecifies whether starting node should be the root node (false) or the current node (true). Default = false ProviderProvider used to obtain site map data ShowStartingNodeSpecifies whether to show the root node

Hiding the Root Site Map Node <asp:SiteMapDataSource ID="SiteMap" ShowStartingNode="false" RunAt="server" /> <siteMapNode title="Training" url="Training.aspx" description="Training for.NET developers"> <siteMapNode title="Programming.NET" url="Classes.aspx?id=1" description="All about the.NET Framework" /> <siteMapNode title="Programming ASP.NET" url="Classes.aspx?id=2" description="All about ASP.NET" /> <siteMapNode title="Programming Web Services" url="Classes.aspx?id=3" description="All about Web services" /> <siteMapNode title="Consulting" url="Consulting.aspx" description="Consulting for.NET projects" /> <siteMapNode title="Debugging" url="Debugging.aspx" description="Help when you need it the most" /> <siteMapNode title="Training" url="Training.aspx" description="Training for.NET developers"> <siteMapNode title="Programming.NET" url="Classes.aspx?id=1" description="All about the.NET Framework" /> <siteMapNode title="Programming ASP.NET" url="Classes.aspx?id=2" description="All about ASP.NET" /> <siteMapNode title="Programming Web Services" url="Classes.aspx?id=3" description="All about Web services" /> <siteMapNode title="Consulting" url="Consulting.aspx" description="Consulting for.NET projects" /> <siteMapNode title="Debugging" url="Debugging.aspx" description="Help when you need it the most" /> Web.sitemap

Name Title Microsoft Corporation SiteMapDataSource

SiteMapPath Controls "Bread crumbs" showing path to page By default, renders current node as static text By default, renders parent nodes as hyperlinks Highly customizable UI Nodes can be stylized and templatized Separators can be stylized and templatized Integrates with site map providers to acquire and path info

Using SiteMapPath

Key SiteMapPath Properties NameDescription CurrentNodeStyleStyle used to render the current node CurrentNodeTemplateHTML template used to render the current node NodeStyle NodeStyleTemplate PathSeparatorStyleStyle used to render node separators PathSeparatorTemplate Style used to render non-current nodes HTML template used to render non-current nodes HTML template used to render node separators PathSeparatorText used for node separators (default = ">")

Stylizing SiteMapPath

Name Title Microsoft Corporation SiteMapPath

Site Map Providers Site maps are provider-based Provider interprets site map data and provides it to SiteMapDataSource controls Provider also tracks current position and provides it to SiteMapPath controls ASP.NET 2.0 ships with one provider XmlSiteMapProvider Use custom providers for other data stores

Site Map API System.Web.SiteMap represents site maps RootNode property identifies root node CurrentNode property identifies current node SiteMapNode represents nodes Interrogate properties of node Walk up, down, and sideways in the hierarchy The magic underlying SiteMapPath controls Foundation for building controls of your own

Using the Site Map API // Write the title of the current node to a Label control Label1.Text = SiteMap.CurrentNode.Title; // Write the path to the current node to a Label control SiteMapNode node = SiteMap.CurrentNode; StringBuilder builder = new StringBuilder (node.Title); while (node.ParentNode != null) { node = node.ParentNode; builder.Insert (0, " > "); builder.Insert (0, node.Title); } Label1.Text = builder.ToString ();