Build C# menu system

Discussion in 'ASP .Net' started by hon123456, Nov 18, 2009.

  1. hon123456

    hon123456 Guest

    Dear all,

    I want to write a c# web page to change the menu
    displayed
    in the main page.


    What I want is I can Add,delete or modify the main menu, add, delete
    or modify submenu. Or change the menu. Now the menu is generated with
    web.sitemap file. So I want to write the menu
    system based on web.sitemap. But I would also like to have other
    method, for example, by text or
    by database. The main purpose is that I can edit menu, add menu and
    sub menu or change it.


    Please reply me on where I can download any sample code. Or would u
    please give me some advice or details on how to implement it.


    thanks
     
    hon123456, Nov 18, 2009
    #1
    1. Advertising

  2. On Nov 18, 3:08 pm, hon123456 <> wrote:
    > Dear all,
    >
    >             I want to write a c# web page to change the menu
    > displayed
    > in the main page.
    >
    > What I want is I can Add,delete or modify the main menu, add, delete
    > or modify submenu. Or change the menu. Now the menu is generated with
    > web.sitemap file. So I want to write the menu
    > system based on web.sitemap. But I would also like to have other
    > method, for example, by text or
    > by database. The main purpose is that I can edit menu, add menu and
    > sub menu or change it.
    >
    > Please reply me on where I can download any sample code. Or would u
    > please give me some advice or details on how to implement it.
    >
    > thanks


    You might want to look at the following examples:

    http://bytes.com/topic/asp-net/answers/588926-editing-web-sitemap-programatically
    http://harriyott.com/2007/03/adding-dynamic-nodes-to-aspnet-site.aspx
     
    Alexey Smirnov, Nov 18, 2009
    #2
    1. Advertising

  3. hon123456 <> wrote in news:ec8defbf-b9e2-4b79-
    :

    > What I want is I can Add,delete or modify the main menu, add, delete
    > or modify submenu. Or change the menu. Now the menu is generated with
    > web.sitemap file. So I want to write the menu
    > system based on web.sitemap. But I would also like to have other
    > method, for example, by text or
    > by database. The main purpose is that I can edit menu, add menu and
    > sub menu or change it.


    Before going forward, the question is WHY? Why do you need a dynamic
    menu?

    If it is because different users, based on authentication, see different
    items, then use security trimmings rather than dynamically dink with the
    menu. You can set up each node to correspond to certain roles and by
    setting security trimmings to true, you can have it respect.

    An even better option is to put the secure pages in their own folder,
    with a locked down web.config. The system automatically respects these
    settings, and it is, imo, more maintainable than constantly whacking the
    sitemap, as you are working in isolation with the secured pages.

    If this is not why you are doing this, then other answers might apply.
    My personal choice for a truly dynamic menu would be move away from
    sitemap and use a database with a custom sitemap provider.

    Peace and Grace,
    Greg

    --
    Vote for Miranda's Christmas Story
    http://tinyurl.com/mirandabelieve

    Twitter: @gbworld
    Blog: http://gregorybeamer.spaces.live.com

    *******************************************
    | Think outside the box! |
    *******************************************
     
    Gregory A. Beamer, Nov 18, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vagif Abilov
    Replies:
    2
    Views:
    588
    Vagif Abilov
    Jul 7, 2004
  2. Pedro Mir
    Replies:
    2
    Views:
    450
    Winista
    Jun 20, 2006
  3. Nicolas Lehuen
    Replies:
    3
    Views:
    736
    Nicolas Lehuen
    Jan 28, 2004
  4. Toon Knapen
    Replies:
    2
    Views:
    369
    Toon Knapen
    May 17, 2006
  5. Guest
    Replies:
    6
    Views:
    14,235
    Sravani
    May 19, 2012
Loading...

Share This Page