Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

In my ASP.NET MVC Partial View I am using a Bootstrap Modal by showing some DropdownList. In same PartialView I am creating some buttons dynamically according to the data fetch with same name. On Button click I am calling a javascript function, inside that function I showing modal like:

$("#MyModal").show();

My problem is when I click on the first button modal shows correctly but without refreshing the page when I click on the some other button Modal disappears and blank screen will appears and we cannot do anything at that time. How to show the same modal on each button click? Please help me to fix this issue.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
178 views
Welcome To Ask or Share your Answers For Others

1 Answer

Have you instantiated the modal?

And .show() is not how you show a bootstrap modal, too.

// To instantiate the modal with no options:
$("#MyModal").modal();


// To show it:
$("#MyModal").modal("show");

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...