1. OutputStream is the raw stream to output the content to the client side, you can customize your output by chaining other stream writersResponse.BinaryWrite, I believe, is for backward compatibility with ASP, it could be using this stream directly , but I have no idea, since I don't have access to the source code2. this content type is normally used when you don't want the browser to open a program registered for the specific content-type/file extension3. what I meant was, <asp:Button runat=server text="download" Onclick="DownloadFile" />runs in the context of current page, if you don't call Response.Clear()
Response.ClearHeaders()
...Response.End()in your DownloadFile method, some garbage content will also be written to the downloaded file, and it is also odd to embed the download logic inside the current page tooyou should be using something like
<a href="download.aspx?id=123">download</a>it is cleaner and more maintainable
for download huge amount of data, look intoStreaming Files Efficiently Using HTTPHandler and ISAPI
http://www.dotnetjunkies.com/Article/E9BE4431-3561-4A64-88C8-A49B2E50CBFA.dcik
Response.ClearHeaders()
...Response.End()in your DownloadFile method, some garbage content will also be written to the downloaded file, and it is also odd to embed the download logic inside the current page tooyou should be using something like
<a href="download.aspx?id=123">download</a>it is cleaner and more maintainable
for download huge amount of data, look intoStreaming Files Efficiently Using HTTPHandler and ISAPI
http://www.dotnetjunkies.com/Article/E9BE4431-3561-4A64-88C8-A49B2E50CBFA.dcik
解决方案 »
- 讨论!有多少程序员是通过东拼西凑代码写程序的?
- 问域名解析配置
- fckeditor 会自动添加 <tbody>标签?
- asp.net页面里面怎么用js显示年月日?
- 求:csdn,能不能搜索2005年10月我参与的贴子
- 一个运行正常的方法,放到用户控件中,出现未实例化的错误,请指点。
- vs2010工具采用MVC架构开发且动态连接数据库
- 急: 在Oracle9里用.NET读写CLOB,怎么传值?怎么取值?
- 在ASP.NET中还有什么类可以像DataBinder.Eval这样可以真接添加在网页HTML代码部分?
- 代码错误,关于用户自定义对象调用的问题,急急急,谢谢
- 很奇怪的一个问题
- 一个奇怪错误,谁能帮我解决??万分感谢!
整个页面为框架网页,分top和main,当下载文件后(下载页面在框架网页的mian页面),原先可用的top上的连接(链接到main)都不可用了,怎么回事??