Why do invisible controls still take up room on asp.net page?

C

COHENMARVIN

I have a page that has a menu running down the left side. When I load
a wide gridview into the page, that gridview doesn't fit to the right
of the menu. So it gets moved below the menu. I tried making the
menu invisible, but the gridview still appears way down on the page.
I can't get rid of the menu, or move it somewhere else, because the
program I'm working on belongs to my company and they want it on the
left side.
Is there some reason why asp.net still acts as if the menu is present
and taking up space? I looked for 'height' attributes and got rid of
the ones that seemed relevant, but this still happens. The menu
itself is a list such as:
<div id="menu" runat="server">
<ul>
<li>
<li>
</ul>
</div>
The grid is part of a usercontrol that is loaded into a placeholder.
Thanks for any suggestions.
Marv
 
G

Göran Andersson

I have a page that has a menu running down the left side. When I load
a wide gridview into the page, that gridview doesn't fit to the right
of the menu. So it gets moved below the menu. I tried making the
menu invisible, but the gridview still appears way down on the page.
I can't get rid of the menu, or move it somewhere else, because the
program I'm working on belongs to my company and they want it on the
left side.
Is there some reason why asp.net still acts as if the menu is present
and taking up space? I looked for 'height' attributes and got rid of
the ones that seemed relevant, but this still happens. The menu
itself is a list such as:
<div id="menu" runat="server">
<ul>
<li>
<li>
</ul>
</div>
The grid is part of a usercontrol that is loaded into a placeholder.
Thanks for any suggestions.
Marv

If you use the css property visibility to make the meny invisible, it's
perfectly natural that it still takes up space. That's how visibility is
supposed to work.

If you want to remove the element from the page flow, use the css
property display:none instead.
 
M

marss

I tried making the
menu invisible, but the gridview still appears way down on the page.
I can't get rid of the menu, or move it somewhere else, because the
program I'm working on belongs to my company and they want it on the
left side.
Is there some reason why asp.net still acts as if the menu is present
and taking up space?

I suppose that you set menu invisibility by CSS:
style="visibility:hidden;". In this case menu is invisible but it
takes a place on the page. Use style="display:none;" instead of it, it
completely hides menu.

I have a page that has a menu running down the left side. When I load
a wide gridview into the page, that gridview doesn't fit to the right
of the menu. So it gets moved below the menu.

If you met with such difficulties using floating layout why you did
not use table layout? It is much easier and behaves more predictable.
<table>
<tr>
<td>menu</td>
<td>grid</td>
</tr>
</table>

Mykola
http://marss.co.ua
 

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
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top