I have this function in my MVC project
ViewPage vp = new ViewPage();
System.Web.UI.Control control = vp.LoadControl(controlName);
开发者_JS百科
if i render a partial control using this function then they render only ASPX based partial control they never render Razor partial control because they are inherited by System.Web.Mvc.WebViewPage
so how i can render the partial view in MVC that can render both type of partial or just render razor partial.
You are correct, I don't believe you can use ASP.NET controls with the Razor engine this way. If you want to ASP.NET controls, I would use the ASP.NET engine for your MVC application instead of Razor.
精彩评论