?
Solved

Response.Redirect in ASP

Posted on 2000-03-17
9
Medium Priority
?
195 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Accepted Solution

by:
daveamour earned 150 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…
Suggested Courses

764 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