I have to create a web site admin panel , with functionality of adding or removing menus and sub menus.When the admin log to the site, he should be add new menus , new sub menus and remove also.
Thanks
Bhanu Dissanayake
Can you be bit specific? Like what kind of menus?
You can user asp.net menu control for this and store its items hierarchy in a DB or XML file and retrieve it on runtime
Jinath Premaratne Microsoft MVP (ASP/ASP.NET) www.jinath.net
Thx Jinath 4 quick reply.If I can use XML file , It's better.
Bhanu
I found a code and i edited it littlebit. Can u help to change this code for dynamically updating ......
// ------------------------------------------------------------------------------------------------------------------------------------------
void Page_Load(Object sender, EventArgs e) { // Create a new Menu control. Menu newMenu = new Menu(); // Set the properties of the Menu control. newMenu.ID = "NavigationMenu"; newMenu.DisappearAfter = 2000; newMenu.Orientation = Orientation.Horizontal; newMenu.Target = "_self"; newMenu.StaticMenuItemStyle.ForeColor = System.Drawing.Color.Black; newMenu.DynamicMenuItemStyle.ForeColor = System.Drawing.Color.Gray; newMenu.DynamicMenuItemStyle.BorderColor = System.Drawing.Color.Blue; newMenu.DynamicMenuItemStyle.BackColor = System.Drawing.Color.AntiqueWhite; newMenu.DynamicMenuItemStyle.BorderStyle = BorderStyle.Outset; newMenu.StaticMenuStyle.BorderWidth = 1; newMenu.StaticMenuStyle.BorderStyle = BorderStyle.Ridge; newMenu.StaticMenuStyle.BackColor = System.Drawing.Color.Fuchsia; // newMenu.DynamicMenuItemStyle.ItemSpacing = 0; newMenu.DynamicMenuItemStyle.BorderWidth = 1; // Create the menu structure.// Menu 2 -------------------------------------------------------------------------------- // Create the root menu item. MenuItem homeMenuItem; homeMenuItem = CreateMenuItem("Home ", "Home.aspx", "Home"); // Create the submenu items. MenuItem musicSubMenuItem; musicSubMenuItem = CreateMenuItem("Music", "Music.aspx", "Music"); MenuItem moviesSubMenuItem; moviesSubMenuItem = CreateMenuItem("MoviesGooooooogle", "Movies.aspx", "Movies"); // Menu 2 --------------------------------------------------------------------------------// create another root menu item MenuItem ProductMenuItem; ProductMenuItem = CreateMenuItem("Products", "Products.aspx", "This is Product"); // Add the submenu items to the ChildItems // collection of the root menu item. homeMenuItem.ChildItems.Add(musicSubMenuItem); homeMenuItem.ChildItems.Add(moviesSubMenuItem);// *************************************************************************************** // Add the root menu item to the ItemsCollection // of the Menu control. newMenu.Items.Add(homeMenuItem); newMenu.Items.Add(ProductMenuItem); // Add the Menu control to the Controls collection // of the PlaceHolder control. MenuPlaceHolder.Controls.Add(newMenu); } MenuItem CreateMenuItem(String text, String url, String toolTip) { // Create a new MenuItem object. MenuItem menuItem = new MenuItem(); // Set the properties of the MenuItem object using // the specified parameters. menuItem.Text = text; menuItem.NavigateUrl = url; menuItem.ToolTip = toolTip; return menuItem; }
http://aspalliance.com/822
If you read above mentioned article, you can identify how to manage Database Driven Hierarchical Menu easily. It is only use ASP.NET Menu, XmlDataSource and XSLT file. So, I guess, you better to try it.
Chandana N. Athauda(MVP - Development Tools - C#)http://www.yeschandana.com
Hello Sir,
Iam S.Janaki from Chennai.I want to know how to add the submenus to a menu control dynamically using javascript.
My email ID is sjanaki1984@gmail.com. Please reply sir
With Regards
SJanaki
HI
i dont think that you can add submenus using javascripts for ASP menu control.
but you can use ASP codings with Ajax.
**** this is a comunity. dont use "Sir" please .
<
</
If you like ill post the entire code here
Plz help me with this
Hi
in this case you can use nother layer for the submenu.
creat a normal menu within that layer and disply it only when u move the mouse over to the parent menu.
hide it when u leave the parent menu,
Hello Bhashitha,
Thankx for your reply sir.But the problem is i never understood what you said.I even asked all here they are telling i dont know.The very problem is im fresher that too trainee.This is the first time im using computers..NET i never had worked nor any trainig is given for me bcoz of which i find very difficult.Please understand my problem and help me
S.Janaki
sjanaki1984@gmail.com
HI can u attacth the full website and can u send a image of the final output that u want.