views:

181

answers:

2

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

+1  A: 

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>
Gregoire
yes, i did, it is still not working
Sasha
@Sasha And also MvcContrib.UI.Grid ?
Gregoire
A: 

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.

Raj Kaimal
i can't open your solution because i am using web developer express.in my project i have a folder 'References' where i have whole bunch of namespaces. I added mvccontrib to that folder and it sits there. Is this what you mean?
Sasha
you were right - i had dll in wrong place
Sasha