說明:執行當前Web請求期間發生未處理的異常。請查看堆棧跟蹤以獲取有關該錯誤的更多信息以及源代碼的位置。System.Web.HttpException:響應在此上下文中不可用錯誤
異常詳細信息:System.Web.HttpException:響應在此上下文中不可用。
Source Error:
Line 10: public void Download(string filename)
Line 11: {
Line 12: Response.ContentType = "application/exe";
Line 13: Response.AppendHeader("Content-Disposition", filename);
Line 14: Response.TransmitFile(Server.MapPath("~/Resources/bb.exe"));
我有一個類中這個方法,我把這種方法,當我點擊一個按鈕
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
public class Common: System.Web.UI.Page
{
}
我要去哪裏錯了
謝謝。我在調用使用反射的方法時遇到了這個問題,即使它在同一個網頁類中。 – styfle