Example #1
0
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        try
        {
            for (int i = 1; i <= this.gvLoginLog.Rows.Count; i++)
            {
                CheckBox cboName = this.gvLoginLog.Controls[0].Controls[i].FindControl("cboName") as CheckBox;
                if (cboName.Checked == true)
                {
                    Label lblId = this.gvLoginLog.Controls[0].Controls[i].FindControl("Label8") as Label;

                    int num = LoginLogManager.DeleteLoginLogById(Convert.ToInt32(lblId.Text));
                }
            }
            Response.Write("<script>alert('删除成功!');</script>");
        }
        catch (Exception)
        {
            Response.Write("<script>alert('删除失败!');</script>");
            throw;
        }
        ShowLoginLog();
    }