views:

54

answers:

1

What is the meaning of the following error message?How can I use the EnableClienTValidation()?

Error 3 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'EnableClientValidation' and no extension method 'EnableClientValidation' accepting a first argument of type 'System.Web.Mvc.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) c:\Dev\DEV\test3\Code\MvcUI\Views\Customer\Create.aspx 11 13 MvcUI

I have reference the following:`" type="text/javascript">

    <script src="<%=Url.Content("~/Scripts/jquery.validate.js")%>" type="text/javascript"></script>

    <script src="<%= Url.Content("~/Scripts/MicrosoftAjax.js")%>" type="text/javascript"></script>
    <script src="<%= Url.Content("~/Scripts/MicrosoftMvcAjax.js")%>" type="text/javascript"></script>
    <script src="<%= Url.Content("~/Scripts/MicrosoftMvcJQueryValidation.js" )%>" type="text/javascript"></script>

`

A: 

Html.EnableClientValidation() helper is available on ASP.NET MVC 2.0. Which version are you using?

Darin Dimitrov
I am using version 1.0. How can I include 2.0?
<add assembly="System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
Here's a tutorial explaining how to migrate an ASP.NET MVC 1.0 application to 2.0 : http://www.asp.net/learn/whitepapers/aspnet-mvc2-upgrade-notes/
Darin Dimitrov