开发者

how to render Partial with inheritence in MVC 3?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜