<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<table width="100%" id="tblGrid" style="display:none">
<tr>
<td align="center">
<asp:GridView ID="myGridView" runat="server" AutoGenerateColumns="false" HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" CellSpacing="5" BorderStyle="Solid" BorderWidth="1" BorderColor="blue">
<Columns>
<asp:TemplateField HeaderText="Delete">
<ItemTemplate>
<asp:CheckBox ID="cbDelete" runat="server" AutoPostBack="false" CausesValidation="false" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="intBenchMark" HeaderText="SID" />
<asp:BoundField DataField="strBenchMarkname" HeaderText="Name" />
</Columns>
</asp:GridView>
</td>
</tr>
<tr>
<td align="center">
<a onclick="javascript:cancelBenchMarks();" style="cursor:hand;color:Blue;text-decoration:underline;">cancel</a>
<asp:LinkButton ID="lnkSave" runat="server">submit</asp:LinkButton>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
Protected Sub lnkSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkSave.Click
For Each dgi As GridView In myGridView.Rows
Dim Sid As Integer = Convert.ToInt32(dgi.Columns(1).ToString)
Dim cb As CheckBox = DirectCast(dgi.FindControl("cbDelete"), CheckBox)
If cb.Checked = True Then
sql = "Delete from tblBenchMarkname where intSid = " & Sid
Response.Write(sql)
Response.End()
insertUpdateDelete(sql)
End If
Next
End Sub
|