I have an error's view in my asp.net
mvc4 application like this:
@model System.Web.Mvc.HandleErrorInfo
@{
ViewBag.Title = "Erreur";
}
<p>Take it easy</p>
<hgroup class="title">
<h1 class="error">Erreur = @Model.Exception</h1>
<h1 class="error">Controller = @Model.ControllerName</h1>
<h1 class="error">Name = @Model.ActionName</h1>
<h2 class="error">Une erreur s'est produite lors du traitement de la requête.</h2>
</hgroup>
The controller code :
public class HomeController : Controller
{
[HttpGet]
public ActionResult Index()
{
return RedirectToAction("Search");
}
public ActionResult Error()
{
return View();
}
public ActionResult About()
{
ViewBag.Message = "Votre page de description d’application.";
return View();
}
public ActionResult Contact()
{
ViewBag.Message = "Votre page de contact.";
return View();
}
The problem is that the Model
is always null. What is the reason for this?