Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 198
  • Last Modified:

Response.Redirect in ASP

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
nravindran
Asked:
nravindran
  • 6
  • 2
1 Solution
 
daveamourCommented:
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
 
daveamourCommented:
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
 
xabiCommented:
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
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
daveamourCommented:
As an afterthought - as soon as you have coded as I said you should call Response.Flush

Dave
0
 
nettromCommented:
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
 
daveamourCommented:
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
 
daveamourCommented:
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
 
daveamourCommented:
Woooooo hooooooo I beat xabi to some points

0
 
xabiCommented:
daveamour i just make this:

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

xabi
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now