Using Ajax.begin form in MVC application

0

I am working on MVC framework and posting my form by Ajax.BeginForm. No Doubt everything works very well but I have applied a ajax loader/Processing that starts work OnBegin and stops on this event OnComplete. So, when this function works after getting success from server:::

   function MessageConfirmation(Json) {
    if ($("#Id").val() > 0 && $("#Id").val() != '') {
    }
    else {
        $("#Id").val(Json.Inserted_ID);
    }
    alert(Json.Message);
}

So, this message called after success but the problem arises when I am updating the page and clicking the submit again and again . So the Above function also works again and again and it brings a pop up alert that shows message. In that pop up if I click on "Prevent this page from creating addtional dialogs", then it shows this error and no alert works

NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMWindow.alert] and ajax loader also keep on processing which is not user friendly at all and it shows if the record is not updated

javascript
jquery
json
asp.net-mvc-3
asp.net-mvc-4
asked on Stack Overflow Jan 31, 2014 by Sweetie • edited Jan 31, 2014 by Sweetie

1 Answer

0

If i get your question right you mean to say that after submit is clicked the success confirmation message is shown and then after subsequent click alert is generated and you want to prevent subsequent click.

answered on Stack Overflow Feb 1, 2014 by user398707

User contributions licensed under CC BY-SA 3.0