Solved

Response.Redirect in ASP

Posted on 2000-03-17
9
193 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
Technology Partners: 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 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Put POST values into cookies. 14 50
Make Float not to Wrap 15 61
XML loaded in a form with dropdown 6 47
hide and show spans from dropdown selection 3 32
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…
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…

738 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