Question

Im using MVC4. I have a [HttpPost] controller method that returns an ActionResult. In this function, when I catch an exception, my plan is to call a [ChildActionOnly] ActionResult method which returns PartialView("ExceptionMessage", exceptionObject). ExceptionMessage.cshtml basically renders a markup with the full Exception object.

Now for some reason, when this PartialView is invoked, the breakpoint within the .cshtml is not being hit.

Why does this not work?

Était-ce utile?

La solution

It was a user error on my part. The view is called when the controller method returns, and thus gets a chance to render the cshtml.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top