SA Developer .NET

Welcome to SA Developer .NET Sign in | Join | Help
in Search

User Editable Menu

Last post 08-12-2008, 10:28 by ProfK. 7 replies.
Sort Posts: Previous Next
  •  08-05-2008, 16:50 13904

    User Editable Menu

    I'm using a Menu control dynamically populated from a database table, and need to provide the users with a facility to edit the menu items.  Currently I only cater for two levels of item, but three are now required.  I would like, if possible, to use the actual menu as a menu editor, when somehow placed in 'edit mode', and I am considering changing the persistence to an XML file to handle the hierarchical relationships better.  My concerns here are being able to limit menu items exposed to certain users only, and to prevent manual editing of the XML file breaking the menu.  Maybe an automated backup that will go to 'last known good menu'.  Suggestions on how I may go about this will be most welcome.

    Unscrambling Eggs: Decompiling ASP.NET
  •  08-06-2008, 13:59 13912 in reply to 13904

    Re: User Editable Menu

  •  08-06-2008, 14:06 13913 in reply to 13912

    Re: User Editable Menu

    When you use the menu object, you can set the data source to be a class, and configure it to get the relevant data out of a database rather then from an XML file. I think that would work better for this... as for editing the menu in "edit mode", I don't think that's possible... I think your best bet is creating admin pages to do that sort of functionality...

    "I would love to change the world, but they won't give me the source code"
    Meeting Place - chat online with anyone, anytime, no downloads or plugins required
  •  08-06-2008, 15:34 13917 in reply to 13913

    Re: User Editable Menu

    You'd have to create a custom menu control to perform the edit capabilities... but that didn't seem to be the point of your question.

    I don't quite follow why XML would be better for hierarchical data than a SQL db?  If you're using 2008 the Node datatype is perfect for it. If not, some type of adjacency matrix seems sufficient...

    Performance wise you should be caching your relatively static result sets (menu structure would fall in this category) which would help negate the performance of navigating the parent/child relationship through SQL (cumbersome even with CTEs).

    Can you perhaps elaborate on your thinking of XML over the DB?


    Why go against tradition when we can admit defeat, live in decline, be the victim of our own design?
    http://dotnet.org.za/calmyourself
  •  08-06-2008, 16:13 13919 in reply to 13917

    Re: User Editable Menu

    CalmYourself:
    Can you perhaps elaborate on your thinking of XML over the DB?

    Using an XML (sitemap) data source would require no coding for hierarchy on my part at all. 


    Unscrambling Eggs: Decompiling ASP.NET
  •  08-07-2008, 13:57 13926 in reply to 13913

    Re: User Editable Menu

    Heat_Rash:
    ... as for editing the menu in "edit mode", I don't think that's possible... I think your best bet is creating admin pages to do that sort of functionality...

    I had an idea last night, that I will try out tonight.  In 'edit mode', I can add 'virtual menu items', such as "Add above", "Add below", "Move up/down" etc,. to all real menu items.


    Unscrambling Eggs: Decompiling ASP.NET
  •  08-11-2008, 17:11 13965 in reply to 13926

    Re: User Editable Menu

    Create admin pages to edit the xml file.

    "That's the thing about people who think they hate computers. What they really hate is lousy programmers."
    Greg - Software Development
  •  08-12-2008, 10:28 13967 in reply to 13965

    Re: User Editable Menu

    You trust a user to edit an XML file?  Even if I did, the want more than a simple file edit, so at very least a treeview is required.  The existing Menu control already provides such a structure, albeit not a real treeview.

    Unscrambling Eggs: Decompiling ASP.NET
View as RSS news feed in XML
Powered by Community Server (Commercial Edition), by Telligent Systems