disabling links in a menu based on current page?

Discussion in 'ASP .Net' started by Sunfire, Nov 16, 2007.

  1. Sunfire

    Sunfire Guest

    Is it possible to test for a hidden value (asp:HiddenField) in a page to
    determine what link should be disabled? Example would be this: On a page
    (AboutUs.aspx for this example), put a <asp:HiddenField> element on the page
    and give it an id of "AboutUs". Then in the layout.master page where the
    menu is do this in the load event:

    switch (AboutUsHiddenField.Value) {
    case "AboutUs":
    MainMenu.Items[1].Enabled=false;
    break;
    //...
    }

    Or is there a better way to do this...
     
    Sunfire, Nov 16, 2007
    #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. jonefer

    simple link disabling on current page

    jonefer, Feb 2, 2007, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    148
    jonefer
    Feb 2, 2007
  2. Wayne Erfling

    Disabling self links with MenuControl

    Wayne Erfling, Nov 7, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    114
    Wayne Erfling
    Nov 7, 2006
  3. Robert Smith

    disabling links

    Robert Smith, Jul 14, 2006, in forum: ASP General
    Replies:
    2
    Views:
    105
    Robert Smith
    Jul 14, 2006
  4. Replies:
    5
    Views:
    140
    Howie
    Jun 19, 2005
  5. Replies:
    3
    Views:
    408
Loading...

Share This Page