I have been looking around looking for a solution for this issue but have yet to arrive to a solution that works. I was using this as a reference but couldn't get anything to work:What is the right way to '#include file' in MVC?

I have an MVC 4 project that uses a Razor for the views and I want to add an aspx page that contains a menu bar that I would to add to the _LayoutPage.cshtml. As of right now I have recreated the menu so it looks the same in my razor view but the issue is that when a change needs to be made to the menu.aspx page I have to make the same changes in my razor view.

So my goal is to just render this menu in my layout.cshtml page.

This is what i have right now but it does not work. Is there anyway to do this?

<div id="page-header">
    @Html.RenderPartial("P:/menu/menu.aspx")
</div>

Related posts

Recent Viewed