We help IT Professionals succeed at work.
Get Started

Ajax and bootstrap modal issue

Wayne Atherton
Last Modified: 2016-02-25
I have bootstrap modal, which is fired on clicking a row within a JQuery DataTable:

$('#tblTestData tbody').on('click', 'tr', function () {

if ($(this).hasClass('selected')) {
else {

The LoadMessages function, basically creates a bunch of HTML, and then calls:


from within the success portion of an ajax call to a c# webmethod.

Within the footer of my Modal, I have a button, which calls another jquery method, to add some of the content to a database. Again, this is a Webmethod, and on success of adding the information into the database, calls:


Now, from this point on, I cant' fire the modal again, without hitting F5 and reloading the page.

I placed and console.log inside the loadMessages function, and can see that this get's called every time I ask to show the modal, but it just doesn't fire.

Can someone please point me to what i'm doing wrong?
Watch Question
Principal Systems Engineer
Top Expert 2005
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE