0

I have a rare bug. I coded a Bootstrap modal window in a project on ASP Net MVC 5, and I manage the content of the modal using AJAX, and the events to open the modal with jQuery.

If I run the project with VS 2017 Enterprise, everything with the modal works fine, but If I run the project with VS 2019 Community the modal window not work, not open, and highlight in dark color all the area.

The resources JavaScript and CSS are reference in the Layout.

This is the code for fill the content in the window, and show it. The action called by AJAX operation return HTML, with the right HTML for Bootstrap-modals.

$("#createObject").click(function (e) {
    e.preventDefault();

    var url = $("#urlContainer").attr('data-url-add-coleccion');

    $.ajax({
        type: 'get',
        url: url,
        data: {},
        success: function (data) {
            $("#modalWindow").html(data);
            $("#modalWindow").modal('show');
        }
    });
});

Any ideas?...

  • This must be to do with the files/HTML being delivered to the browser. So you should carefully inspect (using devtools F12) what files are being sent to the browser when it works (2017) compared to when it doesn't (2019). Once you find the difference, you can track it back to whatever is causing the difference. Assuming you are opening the same project file each time, I doubt it is directly related to VS. – Jim W Jun 13 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.