Cannot redirect after HTTP headers have been sent.

Posted by Anilkumar on Stack Overflow See other posts from Stack Overflow or by Anilkumar
Published on 2010-05-20T05:29:50Z Indexed on 2010/05/20 5:40 UTC
Read the original article Hit count: 201

Filed under:
|

When I try to redirect to another page through Response.Redirect(URL) am getting the following error:- System.Web.HttpException: Cannot redirect after HTTP headers have been sent.

I wrote one Response.Write("Sometext"); and Response.Flush() before calling redirect Method.

In this case how do we use Response.Redirect(URL)?

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET