Click here to Skip to main content
15,887,477 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I am able to show Modal dialog. When we press save button, controller works fine. But from controller returning with
return PartialView("_Customer", collection);
, main layout get disappeared.
Here is my the script to show modal dialag:-
JavaScript
<pre> <script>
        $(function () {
            var placeholderElement = $('#modal-placeholder');
            $(document).on('click', 'button[data-bs-toggle="ajax-modal"]', function (event) {
                var url = $(this).data('url');
                $.get(url).done(function (data) {
                    placeholderElement.html(data);
                    placeholderElement.find('.modal').modal('show');

                });
            });
        })
    </script>



What I have tried:

Changed the sequences of various script file.
Posted
Comments
Member 15627495 26-Jun-22 2:21am    
Hello,

to reload css, you have to set them one more time.
It's an issue with your "which code in Dom" against "which display on screen".

DOM can be completed but not display..
so overload the css by writing a line of code for registering the css online.

yourELEMENT.attr("class",'the_class') will be enough
https://api.jquery.com/attr/
anil_kumar_bhakta 26-Jun-22 7:22am    
this also lost the functionality of select2.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900