我有一个简单的问题。如何从控制器重定向到自定义错误页面并返回HTTP状态码?
例如:
public ActionResult Index()
{
this.Redirect("Not found", 404); //redirect to my error page with code 404
}
new HttpNotFoundResult()
,然后使用内置的错误处理。 - Chris Pratt