-1
다음 코드를 사용하여 파일을 다운로드하고 있지만 Response.End
은 항상 Exception
을 발생 시켰습니다. 해당 비용은 내 애플리케이션 행동에 해당합니까? 그렇다면 어떻게하면 파일을 다운로드 할 수있는 다른 방법을 얻을 수 있습니다. 난 당신이 예외 던져 Response.End
함께 제공 비용을 지불하지 않으려면 파일Response.End() 사용 비용
try
{
DownloadFiles();
Response.End();
}
catch (ThreadAbortException)
{
// Thread.ResetAbort();
}
catch (GSException ex)
{
Response.ClearHeaders();
hdnResult.Value = ex.Message;
// ClientScript.RegisterStartupScript(this.Page.GetType(), "checkDownloadError", "window.parent.checkDownloadError('" + ex.Message + "');", true);
}
catch (Exception)
{
Response.ClearHeaders();
hdnResult.Value = "Oops! Something unexpected happened. Please try again later";
//ClientScript.RegisterStartupScript(this.Page.GetType(), "checkDownloadError", "window.parent.checkDownloadError('Oops! Something unexpected happened. Please try again later');", true);
}
예외는 무엇입니까? –
스레드 중단 예외! –
참조 : http://stackoverflow.com/questions/1087777/is-response-end-considered-harmful –