开发者

Html.RenderAction is not available after including Microsoft.Web.Mvc dll

开发者 https://www.devze.com 2022-12-13 21:15 出处:网络
We want to use Html.RenderAction in our MVC1.0 project. I have downloaded the Futures Microsoft.Web.Mvc d开发者_JAVA百科ll from codeplex, copied it to the bin folder in our project, and added a refere

We want to use Html.RenderAction in our MVC1.0 project. I have downloaded the Futures Microsoft.Web.Mvc d开发者_JAVA百科ll from codeplex, copied it to the bin folder in our project, and added a reference to it.

However, when I try to use it in one of our views, Html.RenderAction is still not available.

It might be just a silly detail I'm missing, but I have no idea what else I have to do :(

P.S. I checked, and I can actually write "Microsoft.Web.Mvc.ViewExtensions.RenderAction" and Visual Studio autocompletes the code just fine, so it seems the dll is correctly included in the project.


You have to add it to the "namespaces" tag in web.config.

 <system.web>
      <pages>
         <namespaces>
           <add namespace="Microsoft.Web.Mvc"/>
         </namespaces>
      </pages>
   </system.web>


RenderAction is part of the MvcFutures project.

Kindness,

Dan


You might need to modify your web.config:

<compilation debug="true">
  <assemblies>
    <add assembly="Microsoft.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
  </assemblies>
</compilation>

<pages>
  <namespaces>
    <add namespace="Microsoft.Web.Mvc"/>
  </namespaces>
</pages>
0

精彩评论

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