stange fontsize problem when downloading
-
I use the following functions for providing file download, but I found once this function is executed, then the fontsize of the whole page become automatically very big. but if I delete "Response.End();", then everything is fine, anyone can tell me why? thanks! Response.ContentType = "pdf/doc/exe/chm"; Response.AppendHeader("Content-Disposition", "attachment; filename=" + str_download_file_name_full); Response.TransmitFile(Server.MapPath("~/downloadfiles/" + str_download_file_name_full)); Response.End();
modified on Sunday, August 30, 2009 1:08 PM
-
I use the following functions for providing file download, but I found once this function is executed, then the fontsize of the whole page become automatically very big. but if I delete "Response.End();", then everything is fine, anyone can tell me why? thanks! Response.ContentType = "pdf/doc/exe/chm"; Response.AppendHeader("Content-Disposition", "attachment; filename=" + str_download_file_name_full); Response.TransmitFile(Server.MapPath("~/downloadfiles/" + str_download_file_name_full)); Response.End();
modified on Sunday, August 30, 2009 1:08 PM
Try to download in a Popup rather than main page.
Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.
-
Try to download in a Popup rather than main page.
Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.
thanks, your suggestion may solve this problem, but I did not intend to do so. by the way, one quesition: if I do not use Response.end(), what is the potential problem caused?
-
thanks, your suggestion may solve this problem, but I did not intend to do so. by the way, one quesition: if I do not use Response.end(), what is the potential problem caused?
Well,
Response.End
will force the Response to end even if there might be a large no of lines being executed after that. It is better to use
Response.Clear
before download andResponse.End
after transmitting the file. :thumbsup:Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.