MVC no longer has Code-Behind classes. What you want is partial.
You would use it like this:
<% Html.RenderPartial("MainMenu.ascx", ViewData["Menu"]); %>
If this menu is on all your pages, you can make your controller a subclass of the user controller class, which first populates the menu data.
If you mess around with the MVC inheritance hierarchy too, you can also create the MenuController class and use the RenderAction in your view / wizard:
<% Html.RenderAction<MenuController>(x => x.MainMenu()); %>
wm_eddie
source share