国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

ASP.NET2.0自動搜索文件組成導航系統

2024-07-10 13:04:46
字體:
來源:轉載
供稿:網友

  asp.net2.0的導航系統確實給帶來方便,但是用過的用戶就會發現導航系統有一個很大的缺陷:他需要你手工編寫web.sitemap,web.sitemap的語法用語句流行話是“相當的簡單”,但是實際運用時,雖然簡單,但是稍微復雜的導航,你肯定出錯。為什么?下面是一個簡單的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>

    說白了,他只是一些sitemapnode 的嵌套,但是嵌套的開閉呼應對人而言,絕對是一個煩點,但是對計算機來說,就喜歡處理這些簡單的關系,所以我們可以編寫一個文件,讓系統自動檢索當前應用程序的頁面并自動生成導航。

  miclae就寫了一篇文章,我已經將他用c#改寫并編譯為dll文件,現在 你只要把該dll文件拷貝到你項目的bin目錄下。并設置導航控件(menu,treeview)為引用該dll,運行時,系統將自動根據你的目錄文件自動生成導航系統。

  當然,該dll文件的功能遠遠不只這些,他會自動去掉app_*和bin目錄,如果你愿意,你完全可以在web.config里配制他,告訴dll 不要把某個目錄進行現實等。

  現在你在添加/刪除文件時,再也不用修改web.sitemap

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 华蓥市| 西吉县| 秦安县| 和顺县| 宿迁市| 北碚区| 肃宁县| 徐州市| 白银市| 丹寨县| 连云港市| 公安县| 时尚| 西乌| 张家川| 公安县| 宣武区| 安龙县| 宜城市| 佛山市| 松潘县| 德庆县| 丹棱县| 营口市| 沁水县| 临漳县| 惠州市| 合山市| 道孚县| 通河县| 湖北省| 康马县| 龙岩市| 四子王旗| 佛教| 冷水江市| 珠海市| 隆化县| 商丘市| 玉门市| 吉木乃县|