Search code examples
asp.netentity-frameworkvisual-studiodynamic-data

How do I validate specific fields in a ASP.NET Dynamic Data Site?


I have built a dynamic data asp.net site and I have scaffolding on. I want to be able to validate specific fields using specific regular expressions when the rows in grid view are in edit mode. I cannot seem to find up to date documentation from Microsoft on how to do this. Where can I go to find out how to accomplish this?


Solution

  • I think you can use client side or server side (remote) validation with JQuery validation plugin. http://docs.jquery.com/Plugins/Validation. You can do it for dynamically added elements and for individual elements in the form too.

    Here are some examples http://www.zachhunter.com/2010/06/jquery-validation-with-asp-net/ http://encosia.com/using-jquery-validation-with-asp-net-webforms/