문제

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