Bootstrap dropdown not working after close bootstrap modal in razor











up vote
0
down vote

favorite












My Bootstrap dropdown not working after close bootstrap modal.
Modal:



   <span class="btn btn-warning btn-sm col-xs-offset-5 col-xs-1"
id="backFromEdit" data-dismiss="modal">

</span>


dropdown:



 <div class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown">
@User.Identity.GetUserName()
<span class="glyphicon glyphicon-triangle-bottom"></span>
</a>
<ul class="dropdown-menu">
<li>@Html.ActionLink("Manage Account", "Index", "Manage", routeValues: null, htmlAttributes: new { title = "Manage" })</li>
<li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li>
</ul>
</div>


The modal contains a partial view and dropdown is in partial view login.
Actually the dropdown starts working on every second time closing the modal(e.g. not working after 1st 3rd 5th close... but work on 2nd, 4th...). Very weird. I came across the same situation if I use .modal('toggle') instead of data-dismiss="modal".
Anyone knows about this?










share|improve this question
























  • You have to clearly state the issue. including a fiddle, will surely help. What is drop?
    – Kumar_Vikas
    Dec 26 '17 at 6:29















up vote
0
down vote

favorite












My Bootstrap dropdown not working after close bootstrap modal.
Modal:



   <span class="btn btn-warning btn-sm col-xs-offset-5 col-xs-1"
id="backFromEdit" data-dismiss="modal">

</span>


dropdown:



 <div class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown">
@User.Identity.GetUserName()
<span class="glyphicon glyphicon-triangle-bottom"></span>
</a>
<ul class="dropdown-menu">
<li>@Html.ActionLink("Manage Account", "Index", "Manage", routeValues: null, htmlAttributes: new { title = "Manage" })</li>
<li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li>
</ul>
</div>


The modal contains a partial view and dropdown is in partial view login.
Actually the dropdown starts working on every second time closing the modal(e.g. not working after 1st 3rd 5th close... but work on 2nd, 4th...). Very weird. I came across the same situation if I use .modal('toggle') instead of data-dismiss="modal".
Anyone knows about this?










share|improve this question
























  • You have to clearly state the issue. including a fiddle, will surely help. What is drop?
    – Kumar_Vikas
    Dec 26 '17 at 6:29













up vote
0
down vote

favorite









up vote
0
down vote

favorite











My Bootstrap dropdown not working after close bootstrap modal.
Modal:



   <span class="btn btn-warning btn-sm col-xs-offset-5 col-xs-1"
id="backFromEdit" data-dismiss="modal">

</span>


dropdown:



 <div class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown">
@User.Identity.GetUserName()
<span class="glyphicon glyphicon-triangle-bottom"></span>
</a>
<ul class="dropdown-menu">
<li>@Html.ActionLink("Manage Account", "Index", "Manage", routeValues: null, htmlAttributes: new { title = "Manage" })</li>
<li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li>
</ul>
</div>


The modal contains a partial view and dropdown is in partial view login.
Actually the dropdown starts working on every second time closing the modal(e.g. not working after 1st 3rd 5th close... but work on 2nd, 4th...). Very weird. I came across the same situation if I use .modal('toggle') instead of data-dismiss="modal".
Anyone knows about this?










share|improve this question















My Bootstrap dropdown not working after close bootstrap modal.
Modal:



   <span class="btn btn-warning btn-sm col-xs-offset-5 col-xs-1"
id="backFromEdit" data-dismiss="modal">

</span>


dropdown:



 <div class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown">
@User.Identity.GetUserName()
<span class="glyphicon glyphicon-triangle-bottom"></span>
</a>
<ul class="dropdown-menu">
<li>@Html.ActionLink("Manage Account", "Index", "Manage", routeValues: null, htmlAttributes: new { title = "Manage" })</li>
<li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li>
</ul>
</div>


The modal contains a partial view and dropdown is in partial view login.
Actually the dropdown starts working on every second time closing the modal(e.g. not working after 1st 3rd 5th close... but work on 2nd, 4th...). Very weird. I came across the same situation if I use .modal('toggle') instead of data-dismiss="modal".
Anyone knows about this?







jquery asp.net-mvc bootstrap-modal bootstrap-4






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 26 '17 at 11:01

























asked Dec 25 '17 at 23:51









DennisL

75110




75110












  • You have to clearly state the issue. including a fiddle, will surely help. What is drop?
    – Kumar_Vikas
    Dec 26 '17 at 6:29


















  • You have to clearly state the issue. including a fiddle, will surely help. What is drop?
    – Kumar_Vikas
    Dec 26 '17 at 6:29
















You have to clearly state the issue. including a fiddle, will surely help. What is drop?
– Kumar_Vikas
Dec 26 '17 at 6:29




You have to clearly state the issue. including a fiddle, will surely help. What is drop?
– Kumar_Vikas
Dec 26 '17 at 6:29












1 Answer
1






active

oldest

votes

















up vote
0
down vote













It is too late but for someone who comes back to this, this happens when bootstrap.js is bound twice. At times when the parent page has reference to bootstrap.js and the modal as well; in that case the click event is not released to parent page.
refer to... Issue reported earlier






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47972780%2fbootstrap-dropdown-not-working-after-close-bootstrap-modal-in-razor%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    It is too late but for someone who comes back to this, this happens when bootstrap.js is bound twice. At times when the parent page has reference to bootstrap.js and the modal as well; in that case the click event is not released to parent page.
    refer to... Issue reported earlier






    share|improve this answer

























      up vote
      0
      down vote













      It is too late but for someone who comes back to this, this happens when bootstrap.js is bound twice. At times when the parent page has reference to bootstrap.js and the modal as well; in that case the click event is not released to parent page.
      refer to... Issue reported earlier






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        It is too late but for someone who comes back to this, this happens when bootstrap.js is bound twice. At times when the parent page has reference to bootstrap.js and the modal as well; in that case the click event is not released to parent page.
        refer to... Issue reported earlier






        share|improve this answer












        It is too late but for someone who comes back to this, this happens when bootstrap.js is bound twice. At times when the parent page has reference to bootstrap.js and the modal as well; in that case the click event is not released to parent page.
        refer to... Issue reported earlier







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 21 at 13:13









        user3104116

        489




        489






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47972780%2fbootstrap-dropdown-not-working-after-close-bootstrap-modal-in-razor%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Berounka

            Sphinx de Gizeh

            Different font size/position of beamer's navigation symbols template's content depending on regular/plain...