views:

20

answers:

1

Hi, I am developing a Web app that is based on ASP.NET 3.5, and i added some page from ASP.NET MVC, everything is ok, until i use the "HTML" helper class, then the page is not being able be render, because this is not recognized.

For Example : Html.BeginForm() => this is not recognize as a method

But if i used "System.Web.Mvc.Html.FormExtensions.BeginForm", which is a extension method itself, it work fine.

Environment : ASP.NET MVC 2 and ASP.NET 3.5

Anyone experiencing this problem?

Thanks.

+2  A: 

Do you have the System.Web.Mvc.Html namespace included in web.config's page assemblies list? I.e.:

<pages>
  <namespaces>
    <add namespace="System.Web.Mvc" />
    <add namespace="System.Web.Mvc.Ajax" />
    **<add namespace="System.Web.Mvc.Html" />**
    <add namespace="System.Web.Routing" />
  </namespaces>
</pages>
maartenba