Panels Question

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
 
M

Marina

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.
 
M

Michael Ramey

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
 
R

Rob Meade

...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
 

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,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top