Skip to content Skip to sidebar Skip to footer

Asp.net Mvc Beta 1 - Where Is Html.renderpartial?

I'm just in the process of upgrading my Preview 5 application to Beta 1, and I'm nearly there save for this one error when trying to render a control: 'System.Web.Mvc.HtmlHelper'

Solution 1:

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>
 <addnamespace="System.Web.Mvc"/>
 <addnamespace="System.Web.Mvc.Ajax"/>
 <addnamespace="System.Web.Mvc.Html"/>
 <addnamespace="System.Web.Routing"/>
 <addnamespace="System.Linq"/>
 <addnamespace="System.Collections.Generic"/>
</namespaces>

Solution 2:

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!

Solution 3:

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

<addnamespace="System.Web.Mvc.Html"/>"  

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

Post a Comment for "Asp.net Mvc Beta 1 - Where Is Html.renderpartial?"