Alex
Alex

Reputation: 628

Problem with MvcContrib

I want to use MvcContrib Grid helper, but i stuck on the problem - it's not working. I downloaded release for mvc 1, i have dll on my hard drive, i added a reference to my project, but i always getting following error: Error 1 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'Grid' and no extension method 'Grid' accepting a first argument of type 'System.Web.Mvc.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) I am using Visual Web Developer 2008 if this is important The question is: how correctly add this to my project? Can you give me step by step instruction? Thanks

Upvotes: 1

Views: 2560

Answers (2)

Raj Kaimal
Raj Kaimal

Reputation: 8304

I don't think you have the reference to the MVcContrib dll added. See my sample app here:

http://weblogs.asp.net/rajbk/archive/2010/05/08/asp-net-mvc-paging-sorting-filtering-using-the-mvccontrib-grid-and-pager.aspx

Note that a reference has been added in the solution to the dll.

Upvotes: 1

Gregoire
Gregoire

Reputation: 24872

Have you add the namespace in your web.config ?

<pages>
    <namespaces>
         ...
       <add namespace="MvcContrib.UI"/>
       <add namespace="MvcContrib.UI.Html"/>
       <add namespace="MvcContrib"/>
    </namespaces>
...
</pages>

Upvotes: 3

Related Questions