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:
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:
Response.ContentType = "application/vnd.ms-excel"
Response.AppendHeader("Content-Disposition", "attachment; filename=" & file.Name)
Catch ex As Exception
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.
I have parent.aspx page which has a grid, the grid has column named Date.
When I double click on that column, the child.aspx page will pop-up.
The pop-up page is a MODAL DIALOG which is the "showModalDialog("child.aspx")".
Now, on that child.aspx dialog page,it has a calendar. If I will change the
date then click update button. The parent.aspx page should automatically refresh
without closing the child.aspx page, but it does not.
There is an example here in codeproject which is exactly the same on my problem
but it uses window.open not dialog. Behavior of window.open and dialog is not the
same. You cannot call the window.opener.document.forms(0).submit(), it will
C# コードMicrosoft End User
The best things in life are free
I have a solution with multiple class library and Asp.net projects.
I want to have a common configuration file for common configuration/settings for all those projects in my solution.
What is the best way to achieve this ? (i didn't find a good solution on the web yet ).
Basically you will take the URL, send a HTTP GET request, the server will return the HTML of the webpage. You will need some string processing (generally called "HTML scraping" if you want to Google) to get the content you're after. Then any image locations you find in your HTML scraping, you will need to get their URLs and send HTTP GET requests for each to download the image data.