Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simple ASP.NET interface question: hiding controls
Message
From
29/08/2005 13:33:18
 
 
To
29/08/2005 13:21:06
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01044818
Message ID:
01044824
Views:
15
This message has been marked as a message which has helped to the initial question of the thread.
>On my way to learning this thing called ASP.NET <g>:
>
>In v1.1 I have a form that has a few labels, dropdowns and textboxes to gather parameters from the user to produce a report. The queries and calculations are done (in a class) and returned as an HTML Table. It is a single page deal. There is an if() checking for PostBack. If PostBack=true then it sets all the page controls.visible property to false and then shows the HTML Table with the results.
>
>I did not see an automatic way for the controls to dissappear by themselves on PostBack so I just turn them invisible but the space where they are is still used as blank rows, therefore the table starts very low on the page.
>
>What is the proper way to hide the controls not wasting their screen real estate?

I don't know if it's "proper" or optimal, but I can tell you what I've done:

- I grouped, and positioned the controls I wanted to hide in a System.Web.UI.WebControls.Table
- since the controls I wanted to hide were now children of the table cells, simply making the .Table invisible seemed to do the trick.

I seem to recall experimenting with other table types but the System.Web.UI.WebControls.Table seemed to hide the most cleanly, with minimal or no wasted space.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform