Вопрос

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?

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top