asp.net给checkBox添加一个绑定属性,后台可以获取

 <asp:CheckBox ID="cbEmail" Checked='<%# Eval("ReceiveEmail")%>' runat="server" CommandArgument='<%# Eval("UserSearchId")%>' AutoPostBack="True" OnCheckedChanged="CheckEmailChanged"  /> 




 protected void CheckEmailChanged(object sender, EventArgs e) {

CheckBox cb = (CheckBox) sender;

int abc=int.Parse(cb.Attributes["CommandArgument"])


}

你可能感兴趣的:(asp.net给checkBox添加一个绑定属性,后台可以获取)