0% found this document useful (0 votes)
167 views

Site Map and WEB

This document provides information on creating a site map for a website using XML, ASP.NET, and connecting to a database using a connection string in the WEB.CONFIG file. It includes code samples for a site map node structure in XML, populating an ASP.NET TreeView and Menu from a site map data source, and executing a SQL query to retrieve and bind data to a GridView control using a connection string from the configuration file.

Uploaded by

antony
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
167 views

Site Map and WEB

This document provides information on creating a site map for a website using XML, ASP.NET, and connecting to a database using a connection string in the WEB.CONFIG file. It includes code samples for a site map node structure in XML, populating an ASP.NET TreeView and Menu from a site map data source, and executing a SQL query to retrieve and bind data to a GridView control using a connection string from the configuration file.

Uploaded by

antony
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Site Map

A . Antony Alex MCA Dr G R D College of Science CBE Tamil Nadu - India

File

Web.sitemap

XML File

<siteMap > <siteMapNode url="" title="" description=""> <siteMapNode url="" title="" description="" /> <siteMapNode url="" title="" description="" /> </siteMapNode> </siteMap>

Navigation View
Tree Menu SiteMapPath

<asp:SiteMapDataSource id="site" runat="server" runat="server" />


<asp:TreeView ID="TreeView1" runat="server" DataSourceID="site" /> <asp:Menu ID="Menu1" runat="server" DataSourceID="site"> <asp:SiteMapPath ID="SiteMapPath1" runat="server" ></asp:SiteMapPath>

<siteMapNode siteMapFile="MySiteMap.sitemap"/>

Global Connection using WEB.CONFIG

WEB.CONFIG
<connectionStrings> <add name="GRDCSConnectionString" connectionString="Data Source=ANTONYSERVER\SQLEXPRESS;Initial Catalog=grdcs;Integrated Security=True" providerName="System.Data.SqlClient" /> </connectionStrings>

Dim mycon = New SqlConnection(ConfigurationManager.ConnectionStrings("GR DCSConnectionString").ConnectionString) Dim ds As DataSet = New DataSet Dim cmd As SqlDataAdapter = New SqlDataAdapter("select * from Student", mycon) cmd.Fill(ds, "Student") GridView1.DataSource = ds.Tables("Student") GridView1.DataBind()

Thank U

You might also like