how i can call a model popup with data by using jquery in mvc

Total Post:13

Points:91
Mvc4 
 962  View(s)
Ratings:
Rate this:
I have been created a mvc application and i want when i click a particular button (Browse)  then a model popup window will be open and it contain all record of  student by using  jQuery and Ajax .But i can not do this what is problem in my jQuery code please help..
$('#btnShow').click(function () {
$('.modal-body').ajax("@Url.Action("AllUserList", "Home")");
$('#divDialog').modal({ show: true });
});
  1. Post:9

    Points:63
    Re: how i can call a model popup with data by using jquery in mvc

    Hi Samuel. Your code is very fine but a little mistake.
    Correct code is.

    $('#btnShow').click(function () {
    $('#divDialog').modal({ show: true });
    $('.modal-body').load("@Url.Action("AllUserList", "Home")");
    });

    Now, you can use this code it give correct answer

      Modified On Apr-11-2018 11:27:55 PM
  1. Post:1

    Points:7
    Re: how i can call a model popup with data by using jquery in mvc

    Hi Samuel, I would prefer bootstrap modal for this task. 

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!