mlsteeves
mlsteeves

Reputation: 1271

Setting the visibility property on a button to true is doing nothing

Here is a snippet of the code that I am working with: (btnEditTop is a System.Web.UI.WebControls.Button)

if( userCanEdit )
{
     this.btnEditTop.Visible = true;
}

When I'm stepping through the code with the debugger. At the start of the if statement, in the watch window, the value of Visible is false. As I step into the if, and after the = true statement, the value of Visible is still false.

This code is in a function that does work it some situations, but not in one case.

There must be something that I am doing that prevents Visible from being set.

Does anyone know what conditions will cause this?

Upvotes: 0

Views: 171

Answers (1)

Tomas McGuinness
Tomas McGuinness

Reputation: 7691

Is it within a container that's also invisible, a div perhaps or a Panel?

Upvotes: 3

Related Questions