Error message

  • Warning: array_slice() expects parameter 1 to be array, null given in tikal_meetup_events() (line 194 of /opt/tikal/htdocs/prd/sites/all/modules/custom/tikal_meetup/tikal_meetup.module).
  • Warning: Invalid argument supplied for foreach() in include() (line 7 of /opt/tikal/htdocs/prd/sites/all/modules/custom/tikal_meetup/article_pages_events.tpl.php).

ASP.NET MVC 2 has validation architecture that support both server-side and client-side validation. ScottGu describes in details how to get validation works in his post ASP.NET MVC 2: Model Validation. The best feature in client-side architecture is that you may use alternative java scripts validation libraries like jQuery validation. There is a steps to get client-side validation works using jQuery validation plug-in:

  1. Download and add to your ASP.NET MVC project following java scripts:

    I assume you put all scripts into /Scripts folder of your MVC application

  2. Enable client side validation
    • add three JavaScript references to your view
    • write one line of code in the view before form

That's it! Now you have Client-side validation using jQuery validation plug-in!