这是我的代码。当我将响应重定向到某个操作时,模型绑定器不起作用。
有谁能够帮我 ?
public void OnException(ExceptionContext filterContext)
{
var action = filterContext.RouteData.Values["action"];
var controller = filterContext.RouteData.Values["controller"];
var values = filterContext.RouteData.Values;
var exceptionMessage = filterContext.Exception.Message;
var exception = filterContext.Exception;
filterContext.ExceptionHandled = true;
ExceptionInfo ExceptionInfo = new ExceptionInfo();
ExceptionInfo.ActionName = action.ToString();
ExceptionInfo.ControllerName = controller.ToString();
ExceptionInfo.ExceptionMessage = exceptionMessage;
filterContext.HttpContext.Response.RedirectToRoute(new
{
action = "Error",
controller = "Home",
ExceptionInfo = ExceptionInfo
});
}
public ActionResult Error(ExceptionInfo ExceptionInfo)
{
return View(ExceptionInfo);
}