Asp.net| Navigation
Asp.net2.0 's navigation system does bring convenience to web development, but used users will find that the navigation system has a big flaw: he needs you to hand-write web.sitemap,web.sitemap grammar phrase popular words is "quite simple", but the actual use, although simple, But a little more complicated navigation, you must be wrong. Why? Here 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>
Plainly, he is just some sitemapnode nesting, but nested opening and closing echoes for people, is definitely a nuisance point, but for computers, like to deal with these simple relationships, so we can write a file, so that the system automatically retrieves the current application page and automatically generate navigation.
Miclae wrote an article that I had rewritten and compiled into a DLL file with C #, and now you just copy the DLL to your project's Bin directory. and set the navigation control (Menu,treeview) to refer to the DLL, the system will automatically generate the navigation system based on your catalog file at runtime.
Of course, the DLL file features far more than that, he will automatically remove the app_* and bin directory, if you want to, you can fully in Web.config, tell the DLL do not put a directory to reality and so on.
Now when you add/delete files, you do not need to modify the Web.sitemap