ASP.NET 2.0 Menu control targets and selecting

Discussion in 'ASP .Net' started by m_hansford@yahoo.com.au, Mar 15, 2006.

  1. Guest

    I have a Menu control that populates from a SiteMap file. It's on my
    Master Page and usually loads content pages.

    I've got 2 problems at the moment:

    - Some of my menu items point to an external web site or to a PDF
    document instead of just loading the next internal page. I want these
    external links to open in a new browser window while retaining the
    default target of _self. How can I do this? The only stuff I've seen so
    far is based around using <menuItem>s.

    - My parent menus are selectable and trigger a postback. I don't want
    them to do this. i just want my leaf nodes to be selectable. I think
    this might have something to do with using templates but the info I've
    found is vague and doesn't apply to menus populated by SiteMap files.

    I also can't find much by way of a reference for writing templates.

    Thanks
    Mike
     
    , Mar 15, 2006
    #1
    1. Advertising

  2. Mike,
    I have the same questions you have. I have searched the web for answers to
    these questions to no avail. I have been using a third party menu control
    from APNSoft which is capable of doing this. I would have thought that if
    Microsoft was going to include a nice configurable menu control in ASP.Net
    2.0 they would have included the ability to control the target of the
    individual menu items. I am trying to use the control with a SQL sitemap
    provider and I cannot even include a link to an external site. I have seen
    one "workaround" for that which involves loading a bogus menu item and then
    modifying it at some point during loading of the page. This does not seem to
    be a desirable way to get around this seeming deficiency to me. If you have
    found the solution to these problems, please post them here.
    Thanks
    --
    Owen


    "" wrote:

    > I have a Menu control that populates from a SiteMap file. It's on my
    > Master Page and usually loads content pages.
    >
    > I've got 2 problems at the moment:
    >
    > - Some of my menu items point to an external web site or to a PDF
    > document instead of just loading the next internal page. I want these
    > external links to open in a new browser window while retaining the
    > default target of _self. How can I do this? The only stuff I've seen so
    > far is based around using <menuItem>s.
    >
    > - My parent menus are selectable and trigger a postback. I don't want
    > them to do this. i just want my leaf nodes to be selectable. I think
    > this might have something to do with using templates but the info I've
    > found is vague and doesn't apply to menus populated by SiteMap files.
    >
    > I also can't find much by way of a reference for writing templates.
    >
    > Thanks
    > Mike
    >
    >
     
    =?Utf-8?B?T3dlbg==?=, May 16, 2006
    #2
    1. Advertising

  3. cshade

    Joined:
    Jan 15, 2008
    Messages:
    1
    solution

    Code:
    protected void Menu1_DataBound(object sender, EventArgs e)
        {
            for (int i = 0; i < this.Menu1.Items.Count; i++)
            {
                
                    Menu1.Items[i].Selectable = false;
                
            }
        }
    
    
    This allowed me to make the parent nodes unselectable while leaving the childern selectable.
     
    cshade, Jan 15, 2008
    #3
    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. smu

    About multiple targets

    smu, Nov 23, 2004, in forum: VHDL
    Replies:
    7
    Views:
    522
    rickman
    Nov 28, 2004
  2. Nina
    Replies:
    0
    Views:
    347
  3. sri
    Replies:
    0
    Views:
    426
  4. where am i

    Iframes and multiple targets

    where am i, Nov 19, 2003, in forum: HTML
    Replies:
    4
    Views:
    4,015
  5. Magnus Warker

    custom targets and eclipse

    Magnus Warker, Mar 9, 2007, in forum: Java
    Replies:
    0
    Views:
    612
    Magnus Warker
    Mar 9, 2007
Loading...

Share This Page