#Render partial with a model in Layout View
问题 I have a MVC project where I want to render my menu using Model. I declare the menu contents at the Session_Start event in Global.asax.cs and using break point i knew that it is filling out correctly. I cannot simply use @Html.Partial("_Menu") inside my _Layout.cshtml And if I do @Html.Partial("_Menu", Model.Something) , I get a Object reference not set to an instance of an object error on the Model. 回答1: First off I would recommend against the session object, but since you're using it then