This project is read-only.

JDA Documentation

Here is where you can find the preliminary documentation for jda.

Decorating your models

public class Contact {
   //Requires that the Username is supplied
   public string Username {get;set;}

   // Requires that the Email Address is supplied and is properly formated
   public string EmailAddress{get;set;}

   // Requires that the Website Property contains a properly formated url string
   // Url is not required.
   public string WebSite{get;set;}

Html Helpers

First things first the Data Annotations must be registered by the DataAnnotationsModelValidatorProvider
this can be accomplished in the Global ASAX file
protected void Application_Start()

    //This is where the magic happens

Next up let's wire the jQuery Validation code in an ASPX page.
At the bottom of an aspx page let's place a javascript block and use our Html Helpers
<script type="text/javascript">
    -- Basic jQuery Validation stuff. It just tells jv to validate the form named createForm.
    -- Our code that wires up the UserName Textbox for use with jQuery Validation. you can see that even though we are
    -- using mutiple annotations we only need to call the ValidationFor method once for each property.
    <%= Html.jQueryValidationFor(model => model.UserName) %>
    <%= Html.jQueryValidationFor(model => model.EmailAddress) %>
    <%= Html.jQueryValidationFor(model => model.WebSite) %>

Last edited Jan 12, 2010 at 3:52 PM by ebertsch, version 4


No comments yet.