Is it possible to use Html.RenderPartial in non-MVC ASP.Net page?
I want to render MVC controls in non-MVC ASP.Net pa开发者_如何学Pythonges. Is this possible?
RenderPartial
is an extension method that extends the HtmlHelper
. The HtmlHelper
's constructor takes a ViewContext
. All 3 of those are in the System.Web.Mvc
namespace. So, you'd have to a the very least reference the Mvc dll. You would also need to create an HTML helper by creating the other 2 objects. I'd be interested if you got it work, but I don't know if it's possible.
We need to reference the MVC dll into the project and also need to define similar structure like Route.config which will have default rout. Also we would have Model, View and Controller folder, in which we should have the Views web.config as well
精彩评论