ASP.NET MVC Beta 1 - where is Html.RenderPartial?

时间秒杀一切 提交于 2019-11-30 18:23:44

And also don't forget to add namespaces like below to the web config, I think preview 5 default web.config does not have System.Web.Mvc.Html in it:

<namespaces>
 <add namespace="System.Web.Mvc"/>
 <add namespace="System.Web.Mvc.Ajax"/>
 <add namespace="System.Web.Mvc.Html"/>
 <add namespace="System.Web.Routing"/>
 <add namespace="System.Linq"/>
 <add namespace="System.Collections.Generic"/>
</namespaces>

Now fixed - the conflict was a difference in Web.config requirements between Preview 5 and Beta 1. The following needs to be added into the system.web compilation assemblies node:

<add assembly="System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

After this change, all of my old HtmlHelper methods magically came back!

aogan

In addition to adding the assembly reference I also had to add the line

 <add namespace="System.Web.Mvc.Html"/>"  

to the pages/namespaces section in web.config file.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!