Panels Question

  • Thread starter Thread starter Rob Meade
  • Start date Start date
R

Rob Meade

hi all,

I have a form with 2 panels...and data form one and a thanking-you one

' Show/Hide the relevant panel
panelForm.Visible = False
panelThankYou.Visible = True

This is what I currently use on my code after a the form has been
successfully completed etc, just wondering, do I need to add the = False bit
for the form panel or will, by making the thankyou one true automatically
make the others false? Should I do it anyway?

Any info appreciated, I only ask because I am about to add a third panel and
I could be writing code I dont really need.

Thanks in advance,

Rob
 
What you do with one panel, doesn't change what happens to the other. There
is no law that says only one panel can be visible at at ime.
 
Oh no, nothing like that would happen automatically, asp.net is going to
display whatever it can (it doesn't just display only one panel at a time).
For readability I'd set everything to the way you want it, when you want it.
I try not to even think of the default "visible" property for panels when
I'm working on making certian ones visible/hidden. Even if the default
value for the panel is already set the way I want it, it can't hurt to reset
it, and makes the code much easier to look at. Just my opinion on the
matter.

HTH,
--Michael
 
...cheers to all for the advice, I have adopted that now (hopefully I'll not
be adding any more panels to this page anyway - heh!)...

Regards

Rob
 
Back
Top