2009-07-18 17 views

Odpowiedz

7

jQuery Forms plugin i działanie ASP.NET MVC powinien wykonać zadanie:

public ActionResult SaveDraft(FormCollection form) 
{ 
    // TODO: Save the form values and return a JSON result 
    // to indicate if the save went succesfully 
    return Json(new { success = true }); 
} 

A Pana zdaniem po prostu wywołać tę akcję okresowo:

setInterval(function() { 
    $('#theFormToSave').ajaxSubmit({ 
     url : 'SaveDraft', 
     success: function (data, textStatus) { 
      if (data.success) { 
       alert('form successfully saved'); 
      } 
     } 
    }); 
}, 30000); 
Powiązane problemy