We have simple code below:
string returnUrl = "/sitecore/content/; WebUtil.Redirect(returnUrl);
However, the the last line above seems to throw an exception below:
6156 2016:11:18 06:41:01 ERROR Application error. Exception: System.Web.HttpException Message: Cannot redirect after HTTP headers have been sent. Source: System.Web at System.Web.HttpResponse.Redirect(String url, Boolean endResponse, Boolean permanent) at Sitecore.Web.WebUtil.Redirect(String path)
Any idea what could be throwing this excpetion?