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
Cassie Mod
NA
488
70.6k
thread aborted asp.net and c#
Apr 18 2016 10:55 AM
hi guys,
I get the following error. when trying to open a document ( from a filestream) in asp.net /c#.
protected void LinkButtonOpenFile_OnClick(Object sender, EventArgs e)
{
try
{
using (var connection = DatabaseLayer.OpenConnection())
{
LinkButton link = (LinkButton)sender;
var FileName = link.Text;
var extention = Path.GetExtension(FileName);
var partnerresourseID = OrganisationLogic.GetPartnerResourceIdByOrgIdAndFileName(sender, connection, null, Convert.ToInt32(ViewState["OrgID"]), FileName);
var logo = OrganisationLogic.GetPartnerResourceById(connection, null, partnerresourseID);
Response.ClearContent();
Response.Buffer = false;
Response.ContentType = ProjectAttachmentLogic.GetContentType(extention);
Response.AddHeader("Content-disposition", "attachment; filename=" + FileName);
Response.BinaryWrite(logo.Data);
Response.OutputStream.Write(logo.Data, 0, logo.Data.Length);
Response.OutputStream.Flush();
Response.End(); // here it crashes and said " Thread is aborted".
}
}
catch (Exception ex)
{
throw;
}
}
Reply
Answers (
1
)
How to display chart from excel file data using asp.net
about abstract and interface