asp.net2.0 automatic search file composition navigation system

Source: Internet
Author: User
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



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.