Solved

Response.Redirect in ASP

Posted on 2000-03-17
9
194 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
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
 
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

726 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