locked
How to show Modal Popup RRS feed

  • Question

  • User1979860870 posted

    Hi

      I have below code and i want in Success it should display Modal Dialog Box with message "Record Successfully Created,:

    function Add() {
        var objLocation = {
            Id: $('#Id').val().toUpperCase(),
            Description: $('#Description').val().toUpperCase()
        };
        $.ajax({
            url: "/Location/Add",
            data: JSON.stringify(objLocation),
            type: "POST",
            contentType: "application/json;charset=utf-8",
            dataType: "json",
            success: function (result) {
                loadData();
                $('#myModal').modal('hide');
                clearTextBox();
            },
            error: function (errormessage) {
                alert(errormessage.responseText);
            }
        });
    }

    Thanks

    Tuesday, May 18, 2021 6:20 AM

All replies

  • User475983607 posted

    jagjit saini

    Hi

      I have below code and i want in Success it should display Modal Dialog Box with message "Record Successfully Created,:

    function Add() {
        var objLocation = {
            Id: $('#Id').val().toUpperCase(),
            Description: $('#Description').val().toUpperCase()
        };
        $.ajax({
            url: "/Location/Add",
            data: JSON.stringify(objLocation),
            type: "POST",
            contentType: "application/json;charset=utf-8",
            dataType: "json",
            success: function (result) {
                loadData();
                $('#myModal').modal('hide');
                clearTextBox();
            },
            error: function (errormessage) {
                alert(errormessage.responseText);
            }
        });
    }

    Thanks

    You did not share enough code for the community to reproduce this issue.  Where is the code that open the modal?  Where is the modal?

    Tuesday, May 18, 2021 10:26 AM