protected void gvEmail_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "showBody") { int id = Convert.ToInt32(e.CommandArgument); EmailRepository htmlBody = new EmailRepository(); Literal ltrDyn = new Literal(); ltrDyn.Text = htmlBody.GetHtmlBody(id); Body.Controls.Add(ltrDyn); btnExtendBody_ModalPopupExtender.Show(); } if (e.CommandName == "download") { int id = Convert.ToInt32(e.CommandArgument); EmailRepository downloadMail = new EmailRepository(); downloadMail.DownloadMail(id); } if (e.CommandName == "UserAdd") { txtEmailId.Text = e.CommandArgument.ToString(); BindDDlUser(); BindRepeater(); btnExAddUsers_ModalPopupExtender.Show(); } if (e.CommandName == "Assign") { txtEmailId.Text = Convert.ToInt32(e.CommandArgument).ToString(); BindDDlController(); BindControllerRepeater(); btnPanalAssign_ModalPopupExtender.Show(); } if (e.CommandName == "changestatus") { var arg = e.CommandArgument.ToString().Split(','); if (!(bool)Session["isAdmin"]) { if (!(arg[1] == "3")) { int emailId = Convert.ToInt32(arg[0]); EmailRepository changeStatus = new EmailRepository(); changeStatus.ChangeStatusInprogress(emailId); gvEmails.DataBind(); } } } if (e.CommandName == "addParentRef") { txtEmailId.Text = Convert.ToInt32(e.CommandArgument).ToString(); btnAddParentRef_ModalPopupExtender.Show(); } }