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.
Why is PartialView not called when being called from another ActionResult method?
-
03-07-2022 - |
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?
Solução
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow