protected void gv_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { CheckBox c = (CheckBox)e.Row.Cells[0].Controls[0]; c.Enabled = true; c.ID = e.Row.Cells[2].Text; c.ToolTip = e.Row.Cells[1].Text; c.AutoPostBack = true; c.CheckedChanged += chk_CheckedChanged; } } protected void chk_CheckedChanged(object sender, EventArgs e) { CheckBox cc = sender as CheckBox; Response.Write(cc.Checked.ToString()); }
<checkbox id="chk" runat="server" autopostback="true" and="" öncheckedchange="chk_CheckedChanged" />
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)