Hi
I need to set the css on some menu items on its hover based on whether they have childitems or not.
"Home" "Manage Customer" "Manage Employee"
"Customer List" "Employee List"
"Customer Detail" "Employee Detail"
The sample menuitems are shown above. I want "Home","Customer List","Customer Detail","Employee List","Employee Detail" to have one css on hover (as they do not have any children)
and "Manage Customer","Manage Employee" should have a different css.
How do I achieve that.
Code
protected void Page_Load(object sender, EventArgs e)
{
MenuItem miHome = new MenuItem("Home", "0");
miHome.NavigateUrl = "http://www.google.com";
MenuItem miManageCustomer = new MenuItem("Manage Customer", "1");
miManageCustomer.NavigateUrl = "javascript:void(0)";
MenuItem miCustomerList = new MenuItem("Customer List", "2");
miCustomerList.NavigateUrl = "http://www.google.com";
miManageCustomer.ChildItems.Add(miCustomerList);
MenuItem miCustomerDetail = new MenuItem("Customer Detail", "3");
miCustomerDetail.NavigateUrl = "http://www.google.com";
miManageCustomer.ChildItems.Add(miCustomerDetail);
MenuItem miManageEmployee = new MenuItem("Manage Employee", "4");
miManageEmployee.NavigateUrl = "javascript:void(0)";
MenuItem miEmployeeList = new MenuItem("Employee List", "5");
miEmployeeList.NavigateUrl = "http://www.google.com";
miManageEmployee.ChildItems.Add(miEmployeeList);
MenuItem miEmployeeDetail = new MenuItem("Employee Detail", "6");
miEmployeeDetail.NavigateUrl = "http://www.google.com";
miManageEmployee.ChildItems.Add(miEmployeeDetail);
menu1.Items.Add(miHome);
menu1.Items.Add(miManageCustomer);
menu1.Items.Add(miManageEmployee);
}