|
|
 |
| 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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

May 30th, 2006, 06:49 PM
|
|
Authorized User
|
|
Join Date: Apr 2004
Location: , , .
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

May 30th, 2006, 10:48 PM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,328
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Yes, you will have to use JavaScript to open a pop-up window. Look up the window.open() method.
|

May 30th, 2006, 11:57 PM
|
|
Authorized User
|
|
Join Date: May 2006
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
with the parameter _blank
|

June 3rd, 2006, 03:39 PM
|
|
Authorized User
|
|
Join Date: Apr 2004
Location: , , .
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

June 3rd, 2006, 10:27 PM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,328
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|

June 5th, 2006, 09:49 PM
|
|
Authorized User
|
|
Join Date: Apr 2005
Location: Fresno, California, USA.
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |