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
Prabu Spark
NA
124
203.8k
Cannot redirect after HTTP headers have been sent
Dec 12 2014 5:03 AM
Hi sir,
I am getting the error "Cannot redirect after HTTP headers have been sent"
while redirecting to another page after the download operation.
I shared the code for your reference. Kindly give me the solution for this problem.
Default.aspx.cs:
*********************
Response.Clear();
Response.ContentType = "application/pdf";
string filePath = "d:\\" + filename + ".pdf";
Response.AddHeader("Content-Disposition", String.Format("attachment;filename=\"{0}\"", filePath));
Response.OutputStream.Write(bytes, 0, bytes.Length);
Response.Buffer = true;
Response.OutputStream.Flush();
Response.OutputStream.Close();
Response.Flush();
Response.Close();
Response.Redirect("StudentHome.aspx");
Reply
Answers (
1
)
File path
How to make read telugu for PDF?..