Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 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 May 30th, 2006, 05:49 PM
Authorized User
 
Join Date: Apr 2004
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default Redirect to new page without closing current page

Hi,
  I have a function to determine what file to open base on user input. I like to open the file and still have the current page open.
Is there a way to open a new web page and still have the current page still open using VB?

Thanks in advance,

Peter
__________________
Peter
 
Old May 30th, 2006, 09:48 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Yes, you will have to use JavaScript to open a pop-up window. Look up the window.open() method.
 
Old May 30th, 2006, 10:57 PM
Authorized User
 
Join Date: May 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

with the parameter _blank

 
Old June 3rd, 2006, 02:39 PM
Authorized User
 
Join Date: Apr 2004
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you but I was wondering about opening it using .NET Visual Basic code, i.e. response.redirect("x.aspx") NOT via hyperlink or JavaScript.

Peter
 
Old June 3rd, 2006, 09:27 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

   A redirect or transfer to another page will not keep the original page open. lt simply moves you to that page in the same browser instance. You HAVE to use javascript in order to open a new window, while keeping the original browser/page instance open.

Jim
 
Old June 5th, 2006, 08:49 PM
Authorized User
 
Join Date: Apr 2005
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Unfortunately, I tried to stay pure C# in my code to as you are trying to stay pure VB. I found out early that is not possible and you will have to pick up a javascript book. You don't have to master it, just get what you need out of it to make your pages richer. In this situation, you will have to do it in javascript. There is hope though. While you are looking up window.open()...look up for .net ClientScript.IsClientScriptBlockRegistered() and ClientScript.RegisterClientScriptBlock(). Those will build up to some code you will most likely use often to toss javascript out to your page whenever a button is clicked or any other server side event.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Closing a Page. akhilhp ASP.NET 2.0 Basics 3 May 1st, 2007 10:03 AM
redirect to page other than default page sarah lee ASP.NET 1.0 and 1.1 Basics 3 December 15th, 2006 05:45 PM
print page that is not the current page crmpicco Javascript How-To 0 July 26th, 2005 09:11 AM
reference of prev. page in current page kasanar ASP.NET 1.0 and 1.1 Professional 1 February 13th, 2005 02:49 PM
closing a pop up which also goes to a new page twowoo HTML Code Clinic 2 October 21st, 2003 04:00 AM





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