私のアプリケーションでは、ファイルをダウンロードする必要があるため、次のコードを使用しています。
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment; filename =" + strFileName + ".xls");
Response.TransmitFile(strFilePath);
Response.End();
Response.End()
私はエラーが発生していますThreadAbortException
このエラーを回避するために、httpApplication.CompleteRequest() を使用しようとしていますが、これも使用できません。
httpApplication.CompleteRequest() を使用したコードは以下のとおりです。
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment; filename =" + strFileName + ".xls");
Response.TransmitFile(strFilePath);
HttpApplication.CompleteRequest();
HttpApplication.CompleteRequest() を使用すると、このエラーが発生します
An object reference is required for the non-static field, method, or property 'System.Web.HttpApplication.CompleteRequest()'
私の疑問を明確にすることができれば幸いです...助けてください....