Solved

response.redirect

Posted on 2004-04-14
7
274 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
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
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 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