I am getting this error Message "cannot redirect after http headers have been sent"
when I am calling response.redirect ("home.aspx").
this error occured after downloading file from gridview which is infragistic control.following code to downloading file..
so how can i redirect to the page.
C#
string fileName=this.Controller.Model.SessionDataContext.FileAttachmentRowData.PhysicalFileName;
byte[] array = this.Controller.Model.SessionDataContext.FileAttachmentRowData.FileContents;
Response.Clear();
Response.Buffer = true;
Response.AddHeader("Content-disposition", "attachment; filename=" + fileName);
Response.AddHeader("Content-Length", array.Length.ToString());
Response.ContentType = "application/pdf";
Response.OutputStream.Write(array, 0, array.Length);
Response.Flush();
Response.Clear();
SenthilkumarRank #387 · 6.5K pointsPosted Apr 18, 2012, 12:36 AM EDT
Remove the Response.Flush() and try to execute it.
Let me know.
Shailendra Jadon2 pointsPosted Jun 21, 2012, 9:02 PM EDT
Any solution how can i download the document and after downloading the document how can I redirect the page.