Click here to Skip to main content
15,884,473 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Messenger in .NET Pin
Lutosław11-Jun-11 10:37
Lutosław11-Jun-11 10:37 
QuestionGood not-ASP.NET 4 book Pin
Lutosław10-Jun-11 22:31
Lutosław10-Jun-11 22:31 
GeneralRe: Good not-ASP.NET 4 book Pin
Anurag Gandhi12-Jun-11 20:54
professionalAnurag Gandhi12-Jun-11 20:54 
AnswerRe: Good not-ASP.NET 4 book Pin
Morgs Morgan12-Jun-11 21:59
Morgs Morgan12-Jun-11 21:59 
QuestionCHAT APPLICATION AND MESSENGER USING .NET [modified] Pin
Member 322226410-Jun-11 6:45
Member 322226410-Jun-11 6:45 
AnswerRe: CHAT APPLICATION AND MESSENGER USING .NET Pin
gavindon10-Jun-11 9:30
gavindon10-Jun-11 9:30 
AnswerRe: CHAT APPLICATION AND MESSENGER USING .NET Pin
Halil ibrahim Kalkan10-Jun-11 9:44
Halil ibrahim Kalkan10-Jun-11 9:44 
QuestionUnable to provide file for download Pin
Dominick Marciano10-Jun-11 5:58
professionalDominick Marciano10-Jun-11 5:58 
I have a page that generates an expense report based on user input. I get the file to generate correctly and saved on the network, but I also provide an option that after the file is created that it is allowed to be saved locally (downloaded). The Excel file is generated using the Aspose library:

expenseReport.Worksheets.RemoveAt("Sheet1")
Dim TempExpenseFile As String = Server.MapPath("~/Temporary Files/") & "Expense Report - " & FirstName & " " & LastName & ".xls"      'Generate a temporary file name
expenseReport.Save(TempExpenseFile, FileFormatType.Excel2003)      'This saves the actual file
Dim file As FileInfo = New FileInfo(TempExpenseFile)


The following code is what I've been trying to work with, to allow the file to download, based on user posts and tutorials:

Try
   Response.ContentType = "application/vnd.ms-excel"
   Response.AppendHeader("Content-Disposition", "attachment; filename=" & file.Name)
   Response.WriteFile(TempExpenseFile)
   Response.End()
Catch ex As Exception
   MsgBox(ex.Message)
End Try


However an exception is always thrown. The message is "Thread was being aborted." From what I read this is caused by Response.End and it is safe to ignore. So I've tried the above code without the Try-Catch block and I've also tried changing Response.WriteFile to Response.TransmitFile however the file is never downloaded. What am I missing here? Thanks in advance for any help.
AnswerRe: Unable to provide file for download Pin
GenJerDan10-Jun-11 7:58
GenJerDan10-Jun-11 7:58 
QuestionLicensing Asp.net web application Pin
Satish_S9-Jun-11 19:44
Satish_S9-Jun-11 19:44 
AnswerRe: Licensing Asp.net web application Pin
Expert Coming9-Jun-11 20:03
Expert Coming9-Jun-11 20:03 
GeneralRe: Licensing Asp.net web application Pin
Satish_S9-Jun-11 20:38
Satish_S9-Jun-11 20:38 
AnswerRe: Licensing Asp.net web application Pin
thatraja9-Jun-11 21:07
professionalthatraja9-Jun-11 21:07 
QuestionRefreshing parent page from modal dialog page [modified] Pin
C#Coudou8-Jun-11 20:11
C#Coudou8-Jun-11 20:11 
AnswerRe: Refreshing parent page from modal dialog page Pin
Orcun Iyigun9-Jun-11 9:10
Orcun Iyigun9-Jun-11 9:10 
QuestionGet Jquery calandar date from textbox Pin
padmanabhan N8-Jun-11 6:06
padmanabhan N8-Jun-11 6:06 
AnswerRe: Get Jquery calandar date from textbox Pin
gavindon8-Jun-11 6:15
gavindon8-Jun-11 6:15 
GeneralRe: Get Jquery calandar date from textbox (correct way of writing question). Pin
Asif Rehman9-Jun-11 9:02
Asif Rehman9-Jun-11 9:02 
QuestionSharing config files between projects Pin
Priya Prk8-Jun-11 5:12
Priya Prk8-Jun-11 5:12 
AnswerRe: Sharing config files between projects Pin
Not Active8-Jun-11 5:57
mentorNot Active8-Jun-11 5:57 
GeneralRe: Sharing config files between projects Pin
Priya Prk8-Jun-11 9:02
Priya Prk8-Jun-11 9:02 
Questioncreate a calendar using datalist Pin
sarumathis7-Jun-11 19:21
sarumathis7-Jun-11 19:21 
AnswerRe: create a calendar using datalist Pin
GlobX7-Jun-11 19:38
GlobX7-Jun-11 19:38 
QuestionURL rewrite sub.domain.com Pin
Jassim Rahma7-Jun-11 2:41
Jassim Rahma7-Jun-11 2:41 
AnswerRe: URL rewrite sub.domain.com Pin
Prasanta_Prince8-Jun-11 21:32
Prasanta_Prince8-Jun-11 21:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.