Correct way to use _viewstart.cshtml and partial Razor views?

If you return PartialView() from your controllers (instead of return View() ), then viewstart. Cshtml will not be executed.

If you return PartialView() from your controllers (instead of return View()), then _viewstart. Cshtml will not be executed.

3 Aha, did not know about the PartialViewResult class. That was what I needed. – Portman Nov 2 '10 at 22:31 2 As a follow-up, I've found that I need to also explicitly set the return type of the action method to PartialViewResult instead of the usual ActionResult.

– Portman Nov 3 '10 at 21:55 @Portman are you seeing issues when the action method's return type is not ActionResult? I'm surprised that this is an issue because the MVC runtime should not behave any differently in this case (i.e. As long as the type returned by the action method is ActionResult or any class derived from it things should just work).

– marcind Nov 3 '10 at 22:37 @marcind I get a Stack Overflow on w3wp. Exe if I set the return type to ActionResult. Works fine if the return type is PartialViewResult.

Think I need to file a Connect bug? – Portman Nov 3 '10 at 23:50 Does sound like one to me - do shout back if you submit a Connect bug, will vote it up. – Dav Nov 3 '10 at 21:49.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions