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?
jquery asp.net-mvc bootstrap-modal bootstrap-4
add a comment |
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?
jquery asp.net-mvc bootstrap-modal bootstrap-4
You have to clearly state the issue. including a fiddle, will surely help. What isdrop
?
– Kumar_Vikas
Dec 26 '17 at 6:29
add a comment |
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?
jquery asp.net-mvc bootstrap-modal bootstrap-4
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
jquery asp.net-mvc bootstrap-modal bootstrap-4
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 isdrop
?
– Kumar_Vikas
Dec 26 '17 at 6:29
add a comment |
You have to clearly state the issue. including a fiddle, will surely help. What isdrop
?
– 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
add a comment |
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
add a comment |
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
add a comment |
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
add a comment |
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
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
answered Nov 21 at 13:13
user3104116
489
489
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
You have to clearly state the issue. including a fiddle, will surely help. What is
drop
?– Kumar_Vikas
Dec 26 '17 at 6:29