why isnt target="_blank" working????

  • Thread starter Jon via DotNetMonster.com
  • Start date
J

Jon via DotNetMonster.com

<siteMapNode title="share price" description="Link to Netcall on the London
Stock Exchange" url="http://www.yahoo.co.uk" role="" target="_blank" />

Hi all

I'm trying to open the Yahoo web site in a new window using the above code in
my asp.net web.sitemap. I'm expecting the target="_blank" bit to make it do
this. but it isnt. Does anyone know why??

Thanks in advance.
 
C

Chris Fulstow

Not sure how this gets implemented, but if it uses client-side script
to open the window then maybe it's being prevented by a popup blocker?
 
D

dandrew22 via DotNetMonster.com

Hey, thanks for replying but I wouldn't have thought it was that. The Yahoo
web site does load up but not in new window. It loads up in the current
window. No pop up messages are being displayed at all. I'm clueless to why
it doesnt work????
 
P

Patrice

For a start I would check the HTML code used to open the window. My first
thought would be that this atttribute is just not used in the created HTML
code... (which control do you use, a menu ?)
 
J

Jon via DotNetMonster.com

Hey Patrice, thanks for replying.
I have an asp.net menu control. Each heading in this control , when clicked,
will load a new page. This new page will load in the current window (so
never is a new window opened). Only one heading on the menu will load a new
page and this is the sub-heading is 'share price' the following is the
sitemap code for this:
<siteMapNode title="share price" description="Link to Netcall on the London
Stock Exchange" url="http://www.yahoo.co.uk" role="" target="_blank" />

The other headings dont have the target="_blank" bit as they will load in the
same window. But the above should load in a new window. I dont have any
other code elsewhere for this. The sitemap has all the navigation code I've
been using. If I need to have code elsewhere to open a new window then what
will I need???

Many thanks in advance.
 
P

Patrice

And have you tried to check the HTML code as suggested ? My guess is that
this atttribute is not used by the menu control when generating the HTML
code.

From
http://msdn2.microsoft.com/en-US/library/system.web.sitemapnode_members(VS.80).aspx,
it looks that the SiteMapNode doesn't have the "target" attribute.
For now it would be a custom attribute that is not used by the menu control.

Once checked this is the case, you could inherit from the menu control to
add this capability. (or perhaps use a js function that uses window.open in
your site map).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,017
Latest member
GreenAcreCBDGummiesReview

Latest Threads

Top