Help - managing visibility of controls

J

John Walker

Hi,
I have a question about the best way of managing how data is displayed on
the screen. Since ASP.NET allows forms to 'submit' only to themselves, how
does one go about managing which controls and text are displayed, based on
which action the user chooses. Say that I want every item on the form to no
longer show once the user clicks OK; is setting Visible property on those
controls the only way to do this. It's just an issue because some forms will
have many controls, and programming it so the Visible property of each one
will be False on 'OK' click (and then back to True again if the user clicks
the CANCEL button) can get tedious. Of course, with ASP(not dotnet), the
'submit' would go to a different page and the controls from the first page
would be gone - which would be what I want. Your input\suggestions is
greatly appreciated.

Thanks,
John
 
D

Drew Robbins

You can put the controls in a Panel or other container control. Then,
setting the Panel's Visible property to false will hide all the controls
in that panel.
 
J

John Walker

Drew,
Do you know if ASP.NET (VB.NET) has any standard container controls other
than Panel? I'm probably doing something wrong, but I seem to have a
difficult time working with the Panel - it's not easy for me to get the
controls placed exactly were I would like them to be in the panel..

Thanks,
John
 
D

Drew Robbins

Try placing a Grid Layout Panel (from the HTML controls toolbox in
VS.NET) inside your Panel control. That should give you the layout
capability and the ability to set the Panel visibility.

You could also use the Grid Layout Panel (which is a specially
configured DIV in the aspx file) without placing it inside a Panel
control. Set it to run at server (id="mMyGridLayout" runat="server").
Then set the Visible property on the the Grid Layout Panel.
 
J

John Walker

I'll give it a shot. Thanks Drew!!

Drew Robbins" <"drew at drewby.com said:
Try placing a Grid Layout Panel (from the HTML controls toolbox in
VS.NET) inside your Panel control. That should give you the layout
capability and the ability to set the Panel visibility.

You could also use the Grid Layout Panel (which is a specially
configured DIV in the aspx file) without placing it inside a Panel
control. Set it to run at server (id="mMyGridLayout" runat="server").
Then set the Visible property on the the Grid Layout Panel.
 
J

John Walker

Drew,
Thanks, the Panel control is working for me. There is still one issue here:
I would like to have two panels in the same place on the form (one will
always be visible while the other is invisible), and in order to be able to
conveniently modify these controls in Visual Studio .NET, I was hoping that
there would be a "SEND TO BACK" action like you would see in VB6. Is there
anything in .NET similar to "SEND TO BACK" which would make it easy to work
with two panels where one 'overlays' the other?

Thanks,
John
 

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

Forum statistics

Threads
474,141
Messages
2,570,817
Members
47,361
Latest member
eitamoro

Latest Threads

Top