-1

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.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Midhun
  • 23
  • 7

1 Answers1

0

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");
Omar Himada
  • 2,540
  • 1
  • 14
  • 31