I'm working on a prototype that makes heavy use of partial views and jQuery. When I use jQuery to do the post and updates to the page my javascript fires as I would expect. If i let Ajax.BeginForm handle it the javascript doesn't execute. An example partial view would be
...
<script type="text/javascript">
$("#FormEdit").ready(function() {
$("#DateOfBirth").mask("99/99/9999");
$("#EffectiveDate").mask("99/99/9999");
$("#TerminationDate").mask("99/99/9999");
$("#SSN").mask("999-99-9999");
});
</script>
<% using (Ajax.BeginForm("Save", "Individual", new AjaxOptions { UpdateTargetId = "editContent"}))
{%>
...
The form is initially loaded using jQuery and the masks work. When the partial view is updated after the post, the ready function doesn't get executed. If I create an OnComplete handler and update the page using jQuery it works. Not sure if I'm doing something wrong or if it is a bug/feature of MVC Ajax.
James