Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i have web application ,there is a menu, i just want control the menu item from the database table.like against each column in the table there is bit datatype so i just if i change its value 1 then that menu item will be display otherwise hide.
Posted
Comments
[no name] 23-Sep-14 4:43am    
have you tried anything buddy?

1 solution

Try this

For main menu item
C#
Menu1.Items[0].Enabled = Convert.ToBoolean(dt.Rows[0]["Status"]);

For child menu item
C#
Menu1.Items[0].ChildItems[0].Enabled = Convert.ToBoolean(dt.Rows[0]["Status"]);

For sub child menu item
C#
Menu1.Items[0].ChildItems[0].ChildItems[0].Enabled = Convert.ToBoolean(dt.Rows[0]["Status"]);

Here dt is your DataTable from Database
Set your indexes as per your requirements.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900