How to open menu item link in new window

Discussion in 'ASP .Net' started by Homer, Sep 11, 2007.

  1. Homer

    Homer Guest

    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.
     
    Homer, Sep 11, 2007
    #1
    1. Advertising

  2. 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:...
    > 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.
    >
     
    Harshal Pachpande, Sep 12, 2007
    #2
    1. Advertising

  3. Homer

    Homer Guest

    On Sep 11, 5:56 pm, "Harshal Pachpande"
    <> 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" <> wrote in message
    >
    > news:...
    >
    >
    >
    > > 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
     
    Homer, Sep 12, 2007
    #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. Freshman
    Replies:
    5
    Views:
    1,041
  2. Ann
    Replies:
    0
    Views:
    163
  3. Gordon
    Replies:
    3
    Views:
    323
    Steven Burn
    Apr 16, 2004
  4. PC HUA
    Replies:
    2
    Views:
    436
    PC HUA
    May 19, 2004
  5. Replies:
    1
    Views:
    253
Loading...

Share This Page