Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.NET 2.0 Menu control targets and selecting

Reply
Thread Tools

ASP.NET 2.0 Menu control targets and selecting

 
 
m_hansford@yahoo.com.au
Guest
Posts: n/a
 
      03-15-2006
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

 
Reply With Quote
 
 
 
 
=?Utf-8?B?T3dlbg==?=
Guest
Posts: n/a
 
      05-16-2006
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


"(E-Mail Removed)" 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
>
>

 
Reply With Quote
 
 
 
 
cshade cshade is offline
Junior Member
Join Date: Jan 2008
Posts: 1
 
      01-15-2008
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
custom targets and eclipse Magnus Warker Java 0 03-09-2007 04:13 AM
Linux and Windows BOTH Targets? Kyle :o\) Computer Support 10 04-12-2006 09:58 AM
Iframes and multiple targets where am i HTML 4 11-20-2003 02:44 PM
PIXs and passing VPN Clients from PC to outside targets Rik Bain Cisco 2 10-30-2003 07:12 PM
Temp and gamma targets for fuji frontier Rich Wellner Digital Photography 3 10-01-2003 10:09 PM



Advertisments