protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { int FaqId = 0; Label l; l = (Label)GridView1.Rows[0].FindControl("lblid"); FaqId = int.Parse(l.Text); //Response.Write("<script>confirm('R U Sure?')</script>"); //lblMsg.Text = "Country Deleted Successfully"; FaqBusinessLayer.DeleteQuestion(FaqId); ShowQuestion(); }
protected void btnDelete_Click(object sender, EventArgs e) { int FaqId = 0; CheckBox chk; foreach (GridViewRow gr in GridView1.Rows) { chk = (CheckBox)gr.FindControl("chkid"); if (chk.Checked == true) { Label l1; l1 = (Label)gr.FindControl("lblid"); FaqId = int.Parse(l1.Text); FaqBusinessLayer.DeleteQuestion(FaqId); ShowQuestion(); } } }