我通過創建自己的屬性來處理MVC中的HandleErrorAttribute,該屬性處理Ajax請求期間引發的異常。該屬性是在這裏: public class AjaxAwareHandleErrorAttribute : HandleErrorAttribute
{
public string PartialViewName { get; set; }
public ov
在我的web.config我已經包括了:現在死亡的黃色屏幕不再顯示 <customErrors mode="On" />
。 我想我必須包含的HandleError屬性我控制器的方法或類本身: [HandleError]
public ActionResult About()
{
throw new Exception("Just an exception");
ret
我有一個ASP.NET MVC 4應用程序。我想使用我的自定義句柄錯誤屬性。爲此我寫了這個類: public class MyHandleErrorAttribute : HandleErrorAttribute
{
public void OnException(ExceptionContext filterContext)
{
Debug.Wri
我試圖重定向到出錯頁面。但它不起作用。 它只是給 - Uh-oh, something went wrong! Error Code: 500在瀏覽器上的消息,而不是重定向到錯誤頁面。錯誤頁面已存在於共享文件夾中。 下面是代碼在控制器: [HandleError(View = "Error")]
public ActionResult Index()
{
int u