I have a summary view of a database table. When clicking on a row in the table, I’d like to have a popup showing the full data plus some controls for manipulating that item. I’ve attached a click handler to the item, which then grabs the primary key from one of the table cells in the row. How can I now pass this primary key to ASP.NET and run server code to query my database and update my UI?
Share
Within the click handler, you need to make a call to an exposed page
/somepage.aspx?id={yourid}which should return the HTML blob that you want to render within the popup you’ve created.You can use the JQuery.load method to do this for you, taking the html generated by your page and transferring it to your popup in one line.
There are other methods, where your page or generic handler can return JSON, which you then parse after making the callback, but this is not the way I would go if you’re just starting out.
If you want help with the popup itself, then you can use a library like qTip2 which has built in Ajax > Popup methods, making the task even easier.