Search code examples
asp.net-mvc-3razorpartial-viewsascx

MVC3 Razor: Is it Possible to Render a Legacy ASCX?


With the Razor view engine in MVC3,

Is it possible to render a legacy ascx?


I was expecting to be able to do something like:

@Html.RenderPartial("Footer.ascx")

Solution

  • Yes. Try this instead:

    @Html.Partial("Footer")
    

    or

    @{ Html.RenderPartial("Footer"); }