65.9K
CodeProject is changing. Read more.
Home

Dynamic sitemap in asp.net 2.0

starIconstarIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIcon

2.26/5 (11 votes)

Mar 6, 2007

viewsIcon

46999

downloadIcon

1040

move,delete ,insert child to your sitemap file

Introduction

sitemap file is xml file that microsoft use this file in asp.net 2.0 ,for developer more challenging feature of this file is using in dynamic way.I wrote a lot of articles in internet but all of them focusing on xml and sql server. Now I use XMLDOMOBJECT for dynamic sitemap.

Using the code

The following list summarizes the steps to use Dynamic sitemap file:

  1. Configure your ASP.NET application
  2. Load default.aspx file
  3. Add first child(shows in Just for the First Time)
  4. then add nodes and your own child

If you know that sitemap file has very nice stracture.for the first time you have root then again first child after that start with nodes and children,that means root start in fact in second tag.

<?xml version="1.0" encoding="utf-8"?>

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

I write with XmlDomObject For the first time that you can add <sitemap> tags then add children and other nodes.

Summary

Dynamic web.sitemap with XmlDomobject is really nice and challenging method for whom want to make dynamic site.