I'm trying to hide txtDisc when lblUserType is not special_user. lblLock is = Locked and visible when txtDisc visiblity is = false vice versa.

So I put it inside the page_Load but the method won't function at all.

 protected void Page_Load(object sender, EventArgs e)
    {
        buttonVisibility();
    }

 private void buttonVisibility()
    {
        if (lblUserType.Text == "special_user")
        {
            txtDisc.Visible = true;
            lblLock.Visible = false;
        }
    }

Related posts

Recent Viewed