By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,719 Members | 1,875 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,719 IT Pros & Developers. It's quick & easy.

Problem with "Cannot redirect after http headers have beent sent" error

P: n/a
In my Page_Load Method, I call a method by asynchronous callback to do some work. It's working fine until it calls back. Here is the problem in my callback method. Basically, I cannot redirect because it keeps on saying that the http headers has already been sent. It looks like it keeps on telling me that the response is complete. So nothing it could do about it. I really don't understand. Here is my code (in the callback method):

//this.CurrentContext.Response.Clear();
this.CurrentContext.Response.Redirect(this.Current Context.Request.ApplicationPath+"/DesktopDefault.aspx?tabindex="+this.CurrentContext .Request.Params["tabindex"]+"&tabid="+this.CurrentContext.Request.Params["tabid"]);

As you could see, I tried to clear the response first as well. Then the response.redirect won't even be evaluated.

If anyone has answer to this, please let me know. Thank you so much in advance

Also, if you anyone could provide or direct me to explanation of what's going on when I use thread in ASP.NET, I'd be really appreciated. Thank you.
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Turns out the aspnet_client folder did not exist under the root of our site.
Once we added it, things started working.

"chsakda" <an*******@discussions.microsoft.com> wrote in message
news:63**********************************@microsof t.com...
In my Page_Load Method, I call a method by asynchronous callback to do some work. It's working fine until it calls back. Here is the problem in my
callback method. Basically, I cannot redirect because it keeps on saying
that the http headers has already been sent. It looks like it keeps on
telling me that the response is complete. So nothing it could do about it. I
really don't understand. Here is my code (in the callback method):
//this.CurrentContext.Response.Clear();
this.CurrentContext.Response.Redirect(this.Current Context.Request.Applicatio
nPath+"/DesktopDefault.aspx?tabindex="+this.CurrentContext .Request.Params["t
abindex"]+"&tabid="+this.CurrentContext.Request.Params["tabid"]);
As you could see, I tried to clear the response first as well. Then the response.redirect won't even be evaluated.
If anyone has answer to this, please let me know. Thank you so much in advance.
Also, if you anyone could provide or direct me to explanation of what's

going on when I use thread in ASP.NET, I'd be really appreciated. Thank you.

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.