Solved

Response.Redirect in ASP

Posted on 2000-03-17
9
186 Views
Last Modified: 2012-08-14
While using response.redirect <url>
i want to open the redirected url to be opened in a new window,
just like a <target> option in client side javascript.

Any suggestions!!!!

Ravindran
0
Comment
Question by:nravindran
  • 6
  • 2
9 Comments
 
LVL 19

Expert Comment

by:daveamour
ID: 2627057
Rather than using response.redirect use

Response.Write ("<Script Language='JavaScript'>"
Response.Write ("window.location.href = 'http://yourpage.htm';")
Response.Write ("</Script>")

Hope this helps

Dave
0
 
LVL 19

Expert Comment

by:daveamour
ID: 2627064
oops thats totally wrong sorry

use the above logic but us

Response.Write ("newWin = window.open ('http://yourpage.htm','NewWin','');")

for the middle line

Dave
0
 
LVL 8

Expert Comment

by:xabi
ID: 2627069
You can't do it via a response.redirect. You can only do this via javascript or VBScript (but from the client side, not the server side). Remember that response.redirect is a server side method.

xabi
0
 
LVL 19

Accepted Solution

by:
daveamour earned 50 total points
ID: 2627073
As an afterthought - as soon as you have coded as I said you should call Response.Flush

Dave
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 7

Expert Comment

by:nettrom
ID: 2627085
I though you also could issue a META refresh with base target set to "_blank", e.g output:

<meta http-equiv="Refresh" content="0;URL=http://www.myserver.com/mypage.html">
<base target="_blank">
0
 
LVL 19

Expert Comment

by:daveamour
ID: 2627098
You could do as nett says but this would have to be conditionally written using the Response Object otherwise the page would never load in the first place
0
 
LVL 19

Expert Comment

by:daveamour
ID: 2627167
You could do as nett says but this would have to be conditionally written using the Response Object otherwise the page would never load in the first place
0
 
LVL 19

Expert Comment

by:daveamour
ID: 2627170
Woooooo hooooooo I beat xabi to some points

0
 
LVL 8

Expert Comment

by:xabi
ID: 2627208
daveamour i just make this:

Question --> Answer
He asked to do it with response.redirect and I said no.

xabi
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now