我通过创建自己的属性来处理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