I am having a webgrid which is having href link in mvc3.
Now, when a link is clicked, then response is returned with some records from server that i want to display on a popup window (data will be comming from server after running a new query in controller after clicking that link and than shown in pop up window).
But i dont want to open a new window. i want to open it in a popup on same browser page.
i dont know weather they have used jQuery or AJAX.But i want to implement same functionality.
Please help me to acheive this
Thanks in advance
You can use any
jQuerypluggin which provides the popup window to do this. Several options are available like fancybox,SimpleModel, Colorbox, jQuery UI dialog, thickbox etc..This is how you will do with jQuery UI dialog.
Step 1)
Include jQuery & jQuery UI Library to your page (or Layout page). You can refer your local copy of refer to a copy from a CDN.
Step 2)
In your grid, Give a
cssclass name to the links so that we can use that for the jQuery selection. Here i gave a CSS classpopupLinkStep 3)
Now enable the jQuery UI Dialog functionality to those links with this specific CSS class
So whenever the user clicks on those links it is going to make call to the HREF attribute value of that link (that action method) and get the result and will show in the Popup window.
make sure you have the action method to handle this request