Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to open menu item link in new window

Reply
Thread Tools

How to open menu item link in new window

 
 
Homer
Guest
Posts: n/a
 
      09-11-2007
Hi,

Is there a way to open a link on a Menu control in a new Window? In
my Intranet site, I have pages where my users use to do their work and
I also have links to outside resources. When the user clicks on one
of the links from the Menu, I want to open them in new windows instead
of the existing one. By doing that, the user can carry on their work
with the various pages and use outside resources as reference.

<siteMapNode title="Outside References" >
<siteMapNode url="http://www.yahoo.com"
title="Yahoo" />
<siteMapNode url="http://www.cnn.com/"
title="CNN" />

Somebody suggested to do this:

instead of href="http://www.google.com" you could put
href="javascript:window.open(.....);"

How does that suggestion work in the context of having to enclose it
within <siteMapNode url=""...?

Does anyone know how to implement it? Can somebody please help me.

 
Reply With Quote
 
 
 
 
Harshal Pachpande
Guest
Posts: n/a
 
      09-12-2007
Try following

<siteMapNode title="Training"
url="javascript:GoTo('http://www.yahoo.com');"/>

where GoTo() is defined as follows:

function GoTo(url)
{
window.open(url);

// Cancel the event bubbling. *This code is browser dependent.*
}

- Harshal

"Homer" <> wrote in message
news: ups.com...
> Hi,
>
> Is there a way to open a link on a Menu control in a new Window? In
> my Intranet site, I have pages where my users use to do their work and
> I also have links to outside resources. When the user clicks on one
> of the links from the Menu, I want to open them in new windows instead
> of the existing one. By doing that, the user can carry on their work
> with the various pages and use outside resources as reference.
>
> <siteMapNode title="Outside References" >
> <siteMapNode url="http://www.yahoo.com"
> title="Yahoo" />
> <siteMapNode url="http://www.cnn.com/"
> title="CNN" />
>
> Somebody suggested to do this:
>
> instead of href="http://www.google.com" you could put
> href="javascript:window.open(.....);"
>
> How does that suggestion work in the context of having to enclose it
> within <siteMapNode url=""...?
>
> Does anyone know how to implement it? Can somebody please help me.
>


 
Reply With Quote
 
 
 
 
Homer
Guest
Posts: n/a
 
      09-12-2007
On Sep 11, 5:56 pm, "Harshal Pachpande"
<harshal_pachpa...@hotmail.com> wrote:
> Try following
>
> <siteMapNode title="Training"
> url="javascript:GoTo('http://www.yahoo.com');"/>
>
> where GoTo() is defined as follows:
>
> function GoTo(url)
> {
> window.open(url);
>
> // Cancel the event bubbling. *This code is browser dependent.*
> }
>
> - Harshal
>
> "Homer" <HomerS...@gmail.com> wrote in message
>
> news: ups.com...
>
>
>
> > Hi,

>
> > Is there a way to open a link on a Menu control in a new Window? In
> > my Intranet site, I have pages where my users use to do their work and
> > I also have links to outside resources. When the user clicks on one
> > of the links from the Menu, I want to open them in new windows instead
> > of the existing one. By doing that, the user can carry on their work
> > with the various pages and use outside resources as reference.

>
> > <siteMapNode title="Outside References" >
> > <siteMapNode url="http://www.yahoo.com"
> > title="Yahoo" />
> > <siteMapNode url="http://www.cnn.com/"
> > title="CNN" />

>
> > Somebody suggested to do this:

>
> > instead of href="http://www.google.com" you could put
> > href="javascript:window.open(.....);"

>
> > How does that suggestion work in the context of having to enclose it
> > within <siteMapNode url=""...?

>
> > Does anyone know how to implement it? Can somebody please help me.- Hide quoted text -

>
> - Show quoted text -


Hi Harshal,

Your suggestion works. Thank you very much.

--Jon

 
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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Open link from Menu control in new window Homer ASP .Net 2 07-03-2007 05:22 PM
ASP.Net 2.0 Insert new item, then display this new item in Edit mo Ann ASP .Net Web Controls 0 03-28-2007 01:11 AM
window.open() doesn't open new Window in Opera PC HUA Javascript 2 05-19-2004 02:29 AM
Open link in new window and the window is small Freshman HTML 5 09-28-2003 04:41 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57