Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Enabling the MenuItem in Menu

Enabling the MenuItem in Menu

Scheduled Pinned Locked Moved Visual Basic
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kalyan_vb
    wrote on last edited by
    #1

    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

    T L 2 Replies Last reply
    0
    • K kalyan_vb

      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

      T Offline
      T Offline
      Tom Deketelaere
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • K kalyan_vb

        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

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        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] }


        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups