TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ajay ghosalkar
NA
1
0
Cannot redirect after http headers have been sent
Apr 18 2012 3:42 AM
Hello
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.
<pre lang="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();
Reply
Answers (
2
)
Articles Storage and Retrieve Mechanism
how to validate a text box in javascript using asp.net c#