Open Modal on GridView Row Command
Notes on How to Open Modal on GridView Row Command. The Update Panel is important when doing it this way. Have the grid and the entire modal within a UpdatePanel. In the Columns section <asp:CommandField ShowSelectButton="True" SelectText="Detail" /> In the markup put function to <script type = "text/javascript"> function openModal() { $('#detailModal').modal('show'); } </script> In the row command protected void grdDetail_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandArgument == string.Empty) { return; } int index = Convert.ToInt32(e.CommandArgument); ...