<asp:gridview id="GrdRole" runat="server" cssclass="table table-striped table-bordered table-hover" emptydatatext="No Records Found" datakeynames="RoleID" xmlns:asp="#unknown">
AllowPaging="true" AutoGenerateColumns="false" AutoGenerateDeleteButton="false" RowStyle-HorizontalAlign="Left" OnPageIndexChanging="GrdRole_PageIndexChanging"
HeaderStyle-HorizontalAlign="Center" GridLines="None" PageSize="10" RowStyle-CssClass="gradeX" AlternatingRowStyle-CssClass="gradeA">
<columns>
<asp:templatefield headertext="Select" itemstyle-width="10px">
<itemtemplate>
<input type="checkbox" runat="server" id="emp" value='<%#Eval("EmployeeNo")%>' />
</itemtemplate>
</asp:templatefield>
<asp:templatefield headertext="User Name" itemstyle-width="90%">
<itemtemplate>
<label><%#DataBinder.Eval(Container.DataItem, "Name")%></label>
</itemtemplate>
</asp:templatefield>
</columns>
<pagerstyle horizontalalign="Right" cssclass="pagination-ys" />
</asp:gridview>
<td>
<asp:button id="submit_button" text="Update" cssclass="btn btn-success" runat="server" onclick="UpdateBtm" xmlns:asp="#unknown" />
</td>
my c#
protected void UpdateBtm(object sender, EventArgs e)
{
foreach (GridViewRow row in GrdRole.Rows)
{
if (row.RowType == DataControlRowType.DataRow)
{
CheckBox chkRow = (row.Cells[0].FindControl("emp") as CheckBox);
if (chkRow.Checked)
{
string storid = row.Cells[0].Text;
ClientScript.RegisterStartupScript(GetType(), "alert", "alert('" + storid + "');", true);
}
}
}
}