datalist 中checkbox多项删除怎么不能用,哪位给看看哪有问题
for(inti=0;i<DataList1.Items.Count;i++){CheckBoxchk=(CheckBox)DataList1.Items[i].Find...
for (int i = 0; i < DataList1.Items.Count; i++)
{
CheckBox chk = (CheckBox)DataList1.Items[i].FindControl("ChkSelect");
if (chk != null && chk.Checked == true)
{
Label L3 = (Label)DataList1.Items[i].FindControl("Label3");
int Uid = Convert.ToInt32(L3.Text);
try
{
Auser.DeleteUser(Uid.ToString());
this.Response.Write("<script language=javascript>alert('删除成功');window.window.location.href='UserAlone.aspx';</script> ");
}
catch
{
Response.Write("<script>alert('删除发生错误!')</script>");
}
}
bind();
}
找不到控件 展开
{
CheckBox chk = (CheckBox)DataList1.Items[i].FindControl("ChkSelect");
if (chk != null && chk.Checked == true)
{
Label L3 = (Label)DataList1.Items[i].FindControl("Label3");
int Uid = Convert.ToInt32(L3.Text);
try
{
Auser.DeleteUser(Uid.ToString());
this.Response.Write("<script language=javascript>alert('删除成功');window.window.location.href='UserAlone.aspx';</script> ");
}
catch
{
Response.Write("<script>alert('删除发生错误!')</script>");
}
}
bind();
}
找不到控件 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询