Menu control - problem with setting selected item

Discussion in 'ASP .Net' started by Eirik Eldorsen, Jul 28, 2006.

  1. I can't figure out how to set that an level1 and level2 item is selected at
    the same time. Is this not possible?

    Here is my code that set selected item:

    private void UpdateMenu()
    {
    foreach (MenuItem n1 in mMeny.Items)
    {
    if (Convert.ToInt32(n1.Value) == selectedLevel1ID)
    {
    n1.Selected = true;
    }
    foreach (MenuItem n2 in n1.ChildItems)
    {
    if (Convert.ToInt32(n2.Value) == selectedLevel2ID)
    {
    n2.Selected = true;
    }
    }
    }
    }


    The code seems to run as expected when I debug, but the generated html code
    dosen't set selected on level1, when an item on level2 is selected.


    Eirik
    Eirik Eldorsen, Jul 28, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wayne Erfling
    Replies:
    0
    Views:
    449
    Wayne Erfling
    Oct 13, 2006
  2. Replies:
    0
    Views:
    1,403
  3. RJN
    Replies:
    0
    Views:
    2,096
  4. Leslie

    Menu control a step behind on Selected Item

    Leslie, Mar 28, 2007, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    410
    Leslie
    May 12, 2008
  5. IntraRELY
    Replies:
    0
    Views:
    474
    IntraRELY
    Jun 9, 2007
Loading...

Share This Page