ASP.Net MVC 3.0 Ajax.ActionLink Onbegin Function true the execute the action?

asp.net-ajax, asp.net-mvc-3

Solution

AjaxOptions on Action Link

OnBegin="isValidDate"

JavaScript

   function isValidDate() {
       var date = $('#dateid').val()'
       //...check date....
       if(date is valid) return true;
       else return false;
    }

this worked

Problem

I have a Ajax Action link, which will call a action Method, In my Ajax Option i have called a Validate function, If this function returns true, then only i would want this Action Execute, not sure how i can get this done? My Ajax ActionLink ``` Ajax.ActionLink("Renew", "Edit", "Controller", new { id = "<#= ID #>" }, new AjaxOptions { OnBegin = "isValidDate", OnSuccess = "DestroyRecreateAccordion", UpdateTargetId = "accordion", InsertionMode = InsertionMode.InsertAfter, }, new { @class = "standard button" }) ``` How can I do this only if isValidDate returns true?

Original source

Related problems