I am an ASP.NET WebForms programmer and I’m very new to ASP.NET MVC3. I’ve got a dropdownlist inside the _Layout view and it needs to be populated on all the pages. I don’t want to have to call some code inside every Controller, so I’ve moved the dropdownlist in a Partial View and put it on the page using @Html.Partial(“_DropDownList”). Do I need to create a controller for this View? If so, how can I specify control it needs to use?
Share
You might want to look at @Html.Action and @Html.RenderAction. They allow you to reference a controller action and return the output.