tags:

views:

10

answers:

1

Hi Everyone.I have a requirement where i need to show the list of data in a jquery dialog once a some link is clicked .I can easily collect the data that has to be shown in the dialog on page load and display the data in the dialog.I will place those data in a hidden div and simply pop it up when the user clicks on the link.But my requirement is that there has to be jquery ajax get when the users clicks on the link and that content should be displayed in the jquery dialog.How can i achieve that.

Thanks In Advance,

Tech Used:Asp.net mvc,Jquery

A: 

When the link is clicked, populate a div (in the below example a div which already exists) using an ajax method such as .load and initialize a dialog on the newly populated div (untested!):

$("#theLink").click(function() {
    $("#myDiv").load("/some/link.html")
               .dialog({ autoOpen: false });
    $("#myDiv").dialog('open');
});

http://api.jquery.com/load/

karim79