Cannot redirect after HTTP headers have been sent.

Server Error in '/' Application.

Cannot redirect after HTTP headers have been sent.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Cannot redirect after HTTP headers have been sent.

Source Error:


Line 6490:	String UserAgent = Trim(Request.ServerVariables["HTTP_USER_AGENT"]);
Line 6491:    long IsBot = Convert2Integer(myHelper.IsUserAgentBot(UserAgent));
Line 6492:    if (IsBot==1) Response.Redirect(GetNonSecureServer());
Line 6493:
Line 6494:    if (IsBot==0) {

Source File: c:\eShopKey\ASP.Net\Shops\Laredoute\www\laredoute.incx    Line: 6492

Stack Trace:


[HttpException (0x80004005): Cannot redirect after HTTP headers have been sent.]
   System.Web.HttpResponse.Redirect(String url, Boolean endResponse, Boolean permanent) +988
   ASP.viewshopproduct_aspx.DoPageRecording(Helper myHelper) in c:\eShopKey\ASP.Net\Shops\Laredoute\www\laredoute.incx:6492
   ASP.viewshopproduct_aspx.ProcessInlineTag(String tag, Shop myShop) in c:\eShopKey\ASP.Net\Shops\Laredoute\www\tags.incx:98
   ASP.viewshopproduct_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\eShopKey\ASP.Net\Shops\Laredoute\www\ViewShopProduct.aspx:1638
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +95
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +132
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7880


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3282.0