Presentation is loading. Please wait.

Presentation is loading. Please wait.

NAVIGATION CONTROLS.

Similar presentations


Presentation on theme: "NAVIGATION CONTROLS."— Presentation transcript:

1 NAVIGATION CONTROLS

2 ASP.NET Site Navigation feature provide a consistent way for users to navigate their site.
As your site grows and as you move pages around in the site, it can become difficult to manage all of the links. ASP.NET Site Navigation enable you to store links to all of your pages in a central location and render those links in lists or navigation menus on each page by including a specific web server control.

3 Navigation

4 SiteMap File You can use a site map to describe the logical structure of your site. You can then manage page navigation by modifying the site map as pages are added or removed, instead of modifying hyperlinks in all of your web pages.

5 Create a Site Map <?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns=" > <siteMapNode url="" title="" description=""> <siteMapNode url="" title="" description="" /> </siteMapNode> </siteMap>

6 Web.sitemap XML document is "very" case sensitive
<?xml version="1.0" encoding="utf-8" ?> <siteMap xmlns=" > <siteMapNode url="Default.aspx" title="Home" description="Home Page"> <siteMapNode url="Assignments.aspx" title="Assignments" description="Programming assignments"> <siteMapNode url="Assignment1.aspx" title="Assignment 1" description="Programming assignment 1" /> <siteMapNode url="Assignment2.aspx" title="Assignment 2" description="Programming assignment 2" /> </siteMapNode> <siteMapNode url="AboutUs.aspx" title="About Us" description="Authors and purposes"> <siteMapNode url="ContactInfo.aspx" title="Contact information" description="Contact phones and s" /> <siteMapNode url="ManagementTeam.aspx" title="Management Teams" description="Introduction of management teams" /> </siteMap>

7 After you have your SiteMap you can use several ASP
After you have your SiteMap you can use several ASP.NET controls to navigate the site : SiteMapPath Menu TreeView

8 SiteMapPath Create a breadcrumb
A single line of text showing the user the location in the website structure. It usually helps end user to know his location in relation to the rest of his site. The SiteMapPath control uses the web.sitemap file by default.

9 Using SiteMapPath <asp:SiteMapPath RunAt="server" />

10 Menu The Menu control displays a standard site navigation menu.
The menu will use the sitemap to display each item and it uses submenus for each item in a lower hierarchy.

11 Bind Menu Control with SiteMapDataSource

12 TreeView Allows the users to navigate through the entire site.
it requires a SiteMapDataSource control which allows the control to automatically get the data for navigation. Each node in the tree is rendered as a hyperlink to the particular page. Add a SiteMap control to the page. Add a treeview control to the page . Using the smart tag pick the SiteMapDataSource as the DataSource. Test it.

13 TreeView

14 Declaring a TreeView <asp:TreeView RunAt="server> <Nodes>
<asp:TreeNode Text="Training" RunAt="server"> <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> <asp:TreeNode Text="Consulting" RunAt="server" NavigateUrl="Consulting.aspx" /> <asp:TreeNode Text="Debugging" RunAt="server" NavigateUrl="Debugging.aspx" /> </Nodes> </asp:TreeView>


Download ppt "NAVIGATION CONTROLS."

Similar presentations


Ads by Google