This error normally occurs when we use Response.Redirect or Server.Transfer or Response.End in your code before completing the actual process the page was doing.
In this case what you have to do is
In place of Response.End you have to use HttpContext.Current.ApplicationInstance.CompleteRequest
in place of Response.Redirect, use the Response.Redirect ("home.aspx", false)
in place of Server.Transfer, use the Server.Execute method