protected void RgvEmailTemplate_ItemCommand(object sender, GridCommandEventArgs e) { try { if (e.CommandName == "ViewEmailTemplate") { e.Item.Selected = true; string ID = e.CommandArgument.ToString(); ViewState["ID"] = string.Empty; RlblTempResult.Text = ""; DataTable dtshowTemplate = DataAccessManager.GetShowTemplateBody(ID, Convert.ToString(Session["CampusID"])); if (dtshowTemplate.Rows.Count > 0) { if (dtshowTemplate.Rows[0]["Body"].ToString() != string.Empty) { REditorTempEmail.Content = dtshowTemplate.Rows[0]["Body"].ToString(); btnSaveEmailTemp.Text = "Update"; txtemailtempTitle.Text = dtshowTemplate.Rows[0]["Title"].ToString(); ViewState["ID"] = ID; // RbtntempActive.Enabled = false; string Checked = dtshowTemplate.Rows[0]["Active"].ToString(); if (Checked == "True") { RbtntempActive.Checked = true; } else { RbtntempActive.Checked = false; } } } } if (e.CommandName == "DeleteEmailTemp") { e.Item.Selected = true; string DeleteID = e.CommandArgument.ToString(); ViewState["ID"] = string.Empty; RlblTempResult.Text = ""; Boolean result = false; result = DataAccessManager.DeleteEmailTemplate(DeleteID, Convert.ToString(Session["CampusID"])); if (result == true) { RlblTempResult.Text = ""; REditorTempEmail.Content = string.Empty; btnSaveEmailTemp.Text = "Save"; txtemailtempTitle.Text = string.Empty; ViewState["ID"] = string.Empty; EmailTemplateBind(); RbtntempActive.Checked = false; } } LRRlblTempResult.Visible = false; } catch (Exception ex) { } }