Reputation: 3733
What's the best way to create a pop-up like modal window that shows upon clicking the Select button in GridView?
<asp:CommandField ShowSelectButton="true" ButtonType="Button" SelectText="Select Me" />
Also, bonus if you know how to implement this via jQuery.
Upvotes: 1
Views: 5821
Reputation: 20367
OnClientClick
and specify your javascript function in there.e.g.
<asp:LinkButton ID="LinkButton1" runat="server" OnClientClick="openModal();" />
If you don't want the page to postback, openModal() should return false
You can create a modal dialog easily with jQuery UI. The options and some examples are available in the docs: http://docs.jquery.com/UI/Dialog
If you only need something really simple, you can also use the jQuery simple modal plugin available here: http://www.ericmmartin.com/projects/simplemodal/ The examples from this plugin will give you a nice looking confirmation dialog, or any other informational window (even embedded iframes).
Upvotes: 3