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

Jim G. picture Jim G. · Jun 30, 2011 · Viewed 7.6k times · Source

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")

Answer

gram picture gram · Jun 30, 2011

Yes. Try this instead:

@Html.Partial("Footer")

or

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