Search code examples
c#asp.net-mvcasp.net-coredialogpopup

Popup dialog not showing details


When i click on the new transaction button it only shows the popup dialog but not the details.I followed the tutorial exactly the same but my popup dialog still doesn't pop up the details in dialog box. Output.

Site.js

showInPopup = (url, title) => {
    $.ajax({
        type:"GET",
        url: url,
        success: function (res) {
            $("#form-modal.modal-body").html(res);
            $("#form-modal.modal-title").html(title);
            $("#form-modal").modal('show');
        }
    })

}

Solution

  • I find that you lack of the "space" in JQuery bracket form-modal .modal-body. The space means that you are selecting a child of div.

        showInPopup = (url, title) => {
            $.ajax({
                type: 'GET',
                url: url,
                success: function (res) {
                    $('#form-modal .modal-body').html(res);
                    $('#form-modal .modal-title').html(title);
                    $('#form-modal').modal('show');
                }
            })
        }
    

    -----------------------------old post----------------------
    The ajax is success, or no window will popup. The problem is on the response. Make sure you could see this page by visit /Transaction/AddOrEdit directly.Then the popup details will show. enter image description here enter image description here

    If the url works you could try change the button to onclick="showInPopup('/Transaction/AddOrEdit','New Transaction')" to see if it works.