web 2.0

ASP.NET(vb.net) & SiteMapDataSource - asp:SiteMapDataSource

ASP.NET(vb.net) & SiteMapDataSource - asp:SiteMapDataSource - The SiteMapDataSource provides a data source control that Web server controls and other controls can use to bind to hierarchical site map data.

ShotDev Focus:
- ASP.NET(vb.net) & SiteMapDataSource - asp:SiteMapDataSource

ASP.NET(vb.net) & SiteMapDataSource - asp:SiteMapDataSource

Tag Control :


<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server"></asp:SiteMapDataSource>

ASP.NET(vb.net) & SiteMapDataSource - asp:SiteMapDataSource

On current project Right Click -> Add New Item

ASP.NET(vb.net) & SiteMapDataSource - asp:SiteMapDataSource

Select SiteMap Item.

ASP.NET(vb.net) & SiteMapDataSource - asp:SiteMapDataSource

Web.sitemap

<?xml version="1.0" encoding="utf-8" ?>
<siteMap>
<siteMapNode title="Home" url="~/Default.aspx" roles="*">
<siteMapNode title="Services" url="~/Services.aspx " >
<siteMapNode title="Training" url="~/Training.aspx" />
</siteMapNode>
<siteMapNode title="Products" url="" />
</siteMapNode>
</siteMap>

Create Sitemap (Web.sitemap)

ASP.NET(vb.net) & SiteMapDataSource - asp:SiteMapDataSource

DragĀ  TreeView Control to ASP.NET Web Form. On TreeView Tasks -> Choose Data Source (SiteMapDataSource)

Example Code

Default.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
<asp:TreeView ID="TreeView1" runat="server" DataSourceID="SiteMapDataSource1">
</asp:TreeView>

</div>
</form>
</body>
</html>

QueryExtender.aspx.vb

Partial Class _Default
Inherits System.Web.UI.Page

End Class

Screenshot

ASP.NET(vb.net) & SiteMapDataSource - asp:SiteMapDataSource

.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (No Ratings Yet)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.