Panel height problem


V

Vince

I've inherited a developer's first ASP.Net site, and he used all grid
layouts and absolute positioning. In most pages he has used multiple panels
with controls in them, all located in the same position, one on top of the
other. Then he hides and shows each one as needed. But this makes it a
nightmare to maintain.

I have switched it to flow layout and got rid of the absolute positioning
styles, but there remains a major problem. Even though each panel is set to
100% width and height, when rendered the panel's height is just big enough
to contain its controls at their smallest size, and there's a bunch of white
space below it (I put a border around the panel so I could see its height).
I can't figure out why. I view source and there's nothing after the panel
that would constrain its height.

Any ideas why this might be happening?

Thanks in advance,
Vince
 
Ad

Advertisements

V

Vince

When I view source there's nothing after the panel's div that would
constrain its height.
 
Ad

Advertisements

C

clintonG

Setting the panel control to 100% does not mean it will occupy 100% of the
page. I'm fairly certain it means it will display 100% of whatever it
contains as it seems you too have discovered. I tested my perception of this
presumption and it seems to be correct. You can place a table with height
and width attributes into a div to confirm and if neccessaryuse a column of
the table to force the heighof the table by using a 1x1 transparent .gif or
..png with height attribute set to whatever you want.

As for the poor implementation you have inherited it would be well worth
your time to rebuild as a process controller, i.e. a wizard. I have found
what I consider to be an excellent example in VB from Visual Studio Magazine
[1]. Whether the design of this particular application is as refined as
possible is not for me to know at this time but I sure am learning a lot
about using interfaces for the type of process implied by the type of
application you seem to be referring to.

I used the free snippets version of Instant C# from Tangible [2] to convert
to C# and it is well worth the time to download and use. After my experience
I would even go as far as recommending a purchase of the full version of
Instant C# which I plan to do after I get my next welfare check ;-)

--
<%= Clinton Gallagher, "Twice the Results -- Half the Cost"
Architectural & e-Business Consulting -- Software Development
NET (e-mail address removed)
URL http://www.metromilwaukee.com/clintongallagher/

[1] http://www.ftponline.com/vsm/2003_04/magazine/columns/aspnet/
[2] http://www.tangiblesoftwaresolutions.com/
 

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

Top