
While working on asp.net project, we will get situation to create a dynamic menu control which will be configurable by admin.
For doing this task we can do like this
Step 1: I have created a table like below

Step 2: Configure the asp.net menu control like this
<%@
Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<style
type="text/css">
.menuItem
{
border:
Solid 1px black;
width:
100px;
padding:
2px;
background-color:
#eeeeee;
}
.menuItem
a
{
color:
blue;
}
.IE8Fix
{
z-index:
1000;
}
</style>
</head>
<body>
<form
id="form1"
runat="server">
<div>
<asp:Menu ID="Menu1" Orientation="horizontal"
StaticMenuItemStyle-CssClass="menuItem"
DynamicMenuItemStyle-CssClass="menuItem" runat="server">
<%– This CSS used for fixing the browser
problem with IE8–%>
<DynamicMenuStyle CssClass="IE8Fix" />
</asp:Menu>
</div>
</form>
</body>
</html>
Azad ChouhanPosted Apr 19, 2013, 7:45 AM
blogs for beginners and freshers http://dotnetlover006.blogspot.in/
Ningappa kanaviPosted Apr 10, 2013, 6:52 AM
sir i am getting error with this code on line view.RowFilter = "ParentID=" + parentMenuItem.Value; i am not possible to resolve this error is Syntax error: Missing operand after '=' operator. please help me on this... Thanks in Advance