I am trying to implement a MVC Razor _Layout.cshtml page that uses a WebForm ascx User Control (non-MVC). I am doing this based off the "Yes" section of this Scott Hansleman article "Mixing Razor Views and WebForms Master Pages with ASP.NET MVC 3" http://www.hanselman.com/blog/MixingRazorViewsAndWebFormsMasterPagesWithASPNETMVC3.aspx
The article says how to use the same ascx User Control in both a webform Site.Master page as well as an MVC Razor _Layout page.
From what I've read elsewhere on Stackoverflow it is possible to use legacy ascx user controls (as well as ASP.NET webform server controls) in MVC pages. Using the following line should render the ascx user control in my Razor _Layout:
@{ Html.RenderPartial("~/UserControls/WebUserControl1.ascx"); }
However, that throws the error:
The view at '~/UserControls/WebUserControl1.ascx' must derive from ViewPage,
ViewPage<TModel>, ViewUserControl, or ViewUserControl<TModel>.
I have also tried the below with similar results:
@Html.Partial("~/UserControls/WebUserControl1.ascx")
What am I missing here?