Enabling the MenuItem in Menu
-
I have one menu control in my Main Page and menu has 5 menu items, I have one ASPX page which as one button. Initially 2 menu items in the menu will be disabled. On click of button in the aspx page those disabled menu items should be enabled. But it is not working. Bellow is the code for enabling the menu items. Protected Sub Sumbit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Sumbit.Click Dim mnControl As Menu mnControl = CType(Master.FindControl("Menu1"), Menu) mnControl.Items(0).ChildItems(4).Enabled = True mnControl.Items(0).ChildItems(5).Enabled = True mnControl.Items(0).ChildItems(3).Enabled = True end sub. Kalyan
-
I have one menu control in my Main Page and menu has 5 menu items, I have one ASPX page which as one button. Initially 2 menu items in the menu will be disabled. On click of button in the aspx page those disabled menu items should be enabled. But it is not working. Bellow is the code for enabling the menu items. Protected Sub Sumbit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Sumbit.Click Dim mnControl As Menu mnControl = CType(Master.FindControl("Menu1"), Menu) mnControl.Items(0).ChildItems(4).Enabled = True mnControl.Items(0).ChildItems(5).Enabled = True mnControl.Items(0).ChildItems(3).Enabled = True end sub. Kalyan
are you getting an error message? at first sight I would think you're childitems index just be 2,3,4 but normally you should get an index out of range exception
-
I have one menu control in my Main Page and menu has 5 menu items, I have one ASPX page which as one button. Initially 2 menu items in the menu will be disabled. On click of button in the aspx page those disabled menu items should be enabled. But it is not working. Bellow is the code for enabling the menu items. Protected Sub Sumbit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Sumbit.Click Dim mnControl As Menu mnControl = CType(Master.FindControl("Menu1"), Menu) mnControl.Items(0).ChildItems(4).Enabled = True mnControl.Items(0).ChildItems(5).Enabled = True mnControl.Items(0).ChildItems(3).Enabled = True end sub. Kalyan
Some rethorical questions: how many ChildItems are there ? are there just buttons ? how can you tell what the indices are for the buttons you want ?
Luc Pattyn
try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }