asp.net panel's visible property not working properly

J

Jeff

Hi all,

I have a panel which I can't set to be visible. I explicitly set
panel.Visible = true, but when I debug and go over that line, the
watch window still displays it as false. Even trying to change the
Visible property to true in the watch window doesn't work. It just
changes back to false as soon as I hit return. Any ideas? I'm really
stumped on this.
 
Joined
Jul 17, 2006
Messages
4
Reaction score
0
(I realise the original post is several years old, but I found it via a search engine, so I thought I'd give an explanation in case anyone else arrives here with the same problem.)

As I understand it, ASP.NET controls can only have their visibility set to true if their parent control is also set Visible=true.

So in the example given, it's quite possible that you can't set the panel's visibility to true if the panel's parent control has its visibility set to false.

This isn't very well documented, and has caught me out in the past.

Hope this helps,

Cheers,
Ceri
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top