p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 1.0 and 1.1 Basics (http://p2p.wrox.com/forumdisplay.php?f=60)
-   -   opening a webpage in a new window (http://p2p.wrox.com/showthread.php?t=61613)

riyadsmail August 30th, 2007 01:24 AM

opening a webpage in a new window
 
I am creating a simple application in asp.net using visual basic as my language. I have multiple web forms in my application. Whenever I click a link in one of my web forms I have redirected the control to another web form. I want this new web form (web page) to be opened in a new internet explorer window without right clicking the link and selecting the 'open in new window' item. Can anyone please help

Hahaha

dparsons August 30th, 2007 08:01 AM

The easiest way would be to just specifiy the target attribute of the link as '_blank'

<a href="foo.aspx" target="_blank">text</a>

You could also add a JavaScript to the onclick event to call window.open();

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET

Professional IIS 7 and ASP.NET Integrated Programming

================================================== =========

riyadsmail August 30th, 2007 11:55 PM

Could u please post the code to add a javascript to the onclick.

Hai

mike_remember August 31st, 2007 06:56 AM

Are you talking about client side code? It could be something simple as below:

<a href="#" onclick="yourjsfunctionname()"></a>

Regards
Mike

To the world you might be one person,
but for someone you might be the whole world.


All times are GMT -4. The time now is 04:20 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.