Window Modal BootStrap does not display styles in components - Asp.net MVC

0

I have a problem that I can not solve for months! I'm using a package of bootStrap and JS styles, in which I referenced them in my _Layout. On all the pages that are rendered and inherit from the Main page, everything works without problems. Just open the windows in modal, that the problems started to appear ... Note that the DropDown located in the page Index is stylized correctly, but the same dropdown in the Create view does not work.

Inorderformymodalstowork,mycontrollerreturnsa"Create" view, but when it loads in the modal (set in the Index), I need to play null for the Layout property, else the window does not open. (This could be a problem). I've tried opening Modals using PartialViews, but it also does not work ...

I'll leave the link to anyone who wants to take a look at the project: link

    
asked by anonymous 29.06.2018 / 13:23

3 answers

0

Dude, there was a similar problem but using the datepicker component and select2, I added in partial to solve this problem.

<script>
$(document).ready(function () {
    $('.select2').select2();

    $('.datepicker').datepicker({
        format: 'dd/mm/yyyy',
        language: 'pt-BR',
        todayBtn: "linked",
        autoclose: true,
        todayHighlight: true,
    });
});
</script>
    
29.06.2018 / 14:00
1

Person, after much exhausting research and patience I found the solution on this site: Problem Resolution

I just added the script below:

<script>
    $('#mySelect2').selectpicker({
        dropdownParent: $('#modalGenerica')
    });
</script>

So the answer from fellow @Adriano Praia was the closest.

Thank you all for the help!

    
30.06.2018 / 14:25
0

Your CSS problem,

You should increase the z-index of the modal element

    
29.06.2018 / 13:46