- Go into design mode and choose the ticker in the top-right corner of the gridview.
- Select "Edit Columns" and choose your CommandField.
- Under the properties (right hand side), select "Convert to TemplateField" and hit OK, and you'll have access to the LinkButton generated by the CommandField.
- Add a property to the LinkButton for
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).