protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Panel PanelRecoveryPass = (Panel)LoginUserControl.FindControl("PanelRecoveryPassword"); if (PanelRecoveryPass != null) { PanelRecoveryPass.Attributes.Add("style", "display:none"); } } }
protected void btnRecovery_Click(object sender, EventArgs e) { Panel PanelRecoveryPass = (Panel)LoginUserControl.FindControl("PanelRecoveryPassword"); if (PanelRecoveryPass != null) { if (PanelRecoveryPass.Attributes.Count > 0) { PanelRecoveryPass.Attributes.Clear(); } else { PanelRecoveryPass.Attributes.Add("style", "display:none"); } } }