protected void btnSelDelRev_Click(object sender, EventArgs e)
{
System.Web.UI.WebControls.CheckBox chkbox;
string UpdStr = "";
foreach (GridViewRow gvr in GridView1.Rows)
{
chkbox = (CheckBox)gvr.FindControl("chkSelect");
if (chkbox.Checked)
{
UpdStr += "," + GridView1.DataKeys[gvr.DataItemIndex]["MailboxID"].ToString();//一次得到所选中的记录
}
}
if (UpdStr.Equals(""))
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "error", "alert('请选择还原所选记录!')", true);
}
else
{
UpdStr = UpdStr.Substring(1, UpdStr.Length - 1);
string strUpd = "update ViewMail set ReadDelete=ReadDelete-2 where MemberID =" + ViewState["MemberID"] + " AND MailboxID in(" + UpdStr + ")";//把选中的记录放回回收站中
Dbconn.ExecuteSql(strUpd);
}
PSControl.Refresh = true;
}
这个可以好象可以 帮我检测下,谢谢.