[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

response.redirect

Posted on 2004-04-14
7
Medium Priority
?
286 Views
Last Modified: 2010-04-15
how can i response.redirect after doing a response.flush? i keep getting cannot redirect after http headers has been send?

thanks

alain
0
Comment
Question by:alain123
7 Comments
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 10826541
this is correct because the headers are used to do the redirect ...

you could write out javascript to do the redirect
0
 
LVL 1

Author Comment

by:alain123
ID: 10826612
hmm. the redirect needs to be done on the server side..
0
 
LVL 9

Expert Comment

by:msdixon
ID: 10827885
Response.Write("<script language=\"javascript\">document.location = 'yourUrlHere.aspx'</script>");
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 5

Expert Comment

by:AdrianJMartin
ID: 10827912
use a javascript to redirect the browser, when you use the Server.Redirect, asp.net actually post a header to the browser to request that the browser redirects to another location:-

<META HTTP-EQUIV="Refresh" CONTENT="0;URL=rediretedpage.htm">  this is in the headwer section of response.

technically you should include the full url on the internet as some browsers can decide not to handle the redirect based on securty settings.

the following javascript can be written to the response at any time will be actioned as soon as the browser parses it

<script language=javascript>
<!--
location.replace("page1.htm")
//-->
0
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 750 total points
ID: 10828064
yes basically you write out the javascript from the server to tell the broswer to redirect ...
0
 
LVL 9

Expert Comment

by:msdixon
ID: 10838075
isn't that what i said? how is that different?
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 10838083
its what I had said previously as well ...
0

Featured Post

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!

Question has a verified solution.

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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Screencast - Getting to Know the Pipeline

829 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