Solved

response.redirect

Posted on 2004-04-14
7
275 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
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.

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

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…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

789 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