Pergunta

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?

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top