Wrox Programmer Forums
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 30th, 2007, 01:24 AM
Registered User
Join Date: Aug 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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

Old August 30th, 2007, 08:01 AM
Wrox Author
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons

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();


================================================== =========
Read this if you want to know how to get a correct reply for your question:
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET

Professional IIS 7 and ASP.NET Integrated Programming

================================================== =========
Old August 30th, 2007, 11:55 PM
Registered User
Join Date: Aug 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

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

Old August 31st, 2007, 06:56 AM
Friend of Wrox
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post

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

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


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening a New Window GailCG ASP.NET 2.0 Basics 14 April 1st, 2008 11:32 AM
Opening New Window p_nut33 Classic ASP Basics 1 August 6th, 2004 08:11 PM
Close Parent window on opening child window pkdev Javascript How-To 8 April 11th, 2004 12:06 PM
Pop-up window, on top of webpage Burton HTML Code Clinic 5 September 3rd, 2003 04:29 AM
Opening New Window james_sellwood ASP.NET 1.0 and 1.1 Basics 5 June 12th, 2003 11:43 AM

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