ASP.NET MVC 3: Creating HttpStatusCodeResult with view based body

added by gpeipman
7/28/2010 6:45:30 AM


My last posts described new action results in ASP.NET MVC 3 – HttpNotFoundResult and HttpStatusCodeResult. Unfortunately these result have no body to send to client but there are times we need it to inform our visitor about problems the way that we don’t go out of information context where visitor is. In this example I will show you how to write your own HttpStatusCodeResult that has also body.