auto saving a draft

// jquery
setInterval(function() {
        url    : 'SaveDraft',
        success: function (data, textStatus) {
            if (data.success) {
                alert('form successfully saved');
}, 30000);

// action
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 });

You can try using AJAX to achieve this. Please have a go at the threads below how to achieve this.

or have a look at this for AutoSaving example

or use jQuery as following

Hope this helps.

No comment

Bir cevap yazın

E-posta hesabınız yayımlanmayacak.