The navigation system of ASP.NET 2.0 does bring convenience to web development, but users who have used it will find that the navigation system has a big flaw: it requires you to manually write web.sitemap, and the syntax of web.sitemap is popular with statements. The words are "quite simple", but in actual use, although it is simple, you will definitely make mistakes with slightly complicated navigation. Why? Below is a simple sitemap,
<siteMap>
<siteMapNode title="Home" url="~/default.aspx" >
<siteMapNode title="Introduction to ASP.NET" url="~/introduction/default.aspx">
<siteMapNode title="What's New in Whidbey?" url="~/introduction/whatsnew.aspx"/>
<siteMapNode title="Sample Applications (Starter Kits)" url="~/introduction/starterkits.aspx"/>
<siteMapNode title="Introduction to Visual Web Developer" url="~/introduction/vwd.aspx"/>
</siteMapNode>
<siteMapNode title="Building A Web Application" url="~/development/default.aspx">
<siteMapNode title="Building a Simple Application" url="~/development/simple/default.aspx">
<siteMapNode title="Introduction to ASP.NET pages" url="~/development/simple/pages.aspx"/>
<siteMapNode title="Introduction to Server Controls" url="~/development/simple/servercontrols.aspx"/>
<siteMapNode title="Inline vs Code Behind Pages" url="~/development/simple/codeseparation.aspx"/>
<siteMapNode title="Sharing Code Between Pages" url="~/development/simple/codedirectory.aspx"/>
</siteMapNode>
</siteMap>
To put it bluntly, it is just a nesting of some siteMapNode, but the opening and closing of the nested response is definitely an annoyance for humans, but for computers, they like to deal with these simple relationships, so we can Write a file that allows the system to automatically retrieve the pages of the current application and automatically generate navigation.
miclae wrote an article. I have rewritten it in C# and compiled it into a DLL file. Now you only need to copy the DLL file to the bin directory of your project. And set the navigation control (menu, treeview) to reference the DLL. When running, the system will automatically generate a navigation system based on your directory file.
Of course, the functions of this DLL file are far more than these. It will automatically remove the APP_* and bin directories. If you want, you can configure it in web.config and tell the dll not to display a certain directory.
Now you no longer need to modify web.sitemap when adding/deleting files
http://www.cnblogs.com/mqingqing123/archive/2006/09/04/494616.html