Recent Posts

Wednesday, October 1, 2008

How to build website site map without writing single line of code in asp .net 2.0 ?

This is a step by step asp net 2.0 tutorial on how to create a site map for your web site.

Site maps can be very important for every website to increase search engine rankings. When we submit url to search engines the search engines use site maps to crawl the web sites.

So they can be very vital for search engine optimisation and to improve your web site search engine rankings.Most traditional way of maintaining site maps were in plain html formats which could be a major drawback when a website pages keep on changing and new web pages are being added.

Now Asp.net 2.0 have introduced a special file called web.sitemap that can be included in the project and just making few changes in this file the sitemap of the website can be managed.

Now lets see how to develop a site map for a web site using asp.net 2.0

step 1

open a web project and add web.sitemap in the root directory
add a web form and name it sitemap.aspx

now manage your site map as shown below :
SiteMapNode element is every page in your site. Manage the elements as per your web sites and give the path of your web pages.

Since the site map is stored in XML format it can be very useful in using it as a datasource and bind it in the tree view control to display the tree structure in your web page.
Step 2

Add a SiteMapDataSource control in your siteMap.aspx page

Add a Treeview control in your sitemap.aspx page

and set the tree view datasourceID="SiteMapDataSource1"

which will look like the following:
Now run the application and you can view a site map for your web site

References:
Introducing Microsoft Visual Basic 2005 for Developers
Microsoft Press

Related Posts by Categories




No comments:

Post a Comment