[Resolved] Forcing usercontrol height to equal placeholder height?
Ahoy,
I have a usercontrol that currently consists of just one table (or possibly a div). The placeholder that will hold this usercontrol does not have a set height, and will change according to other placeholders on the form.
I would like to force the height of the table, and therefore the usercontrol, to equal the height of the placeholder (whatever it might be).
Can this be done?
thanks
Re: Forcing usercontrol height to equal placeholder height?
I think you'll find a placeholder control doesn't have a height property it isn't really a physical entity at all just a positioning element.
What you need to do is find the required height from what is containing the placeholder. You could then create a public height property for your user control and set it when you add the user control to the placeholder at runtime.
Give a shout if I've misunderstood in any way.
DJ
Re: Forcing usercontrol height to equal placeholder height?
Code:
<%@ Control Language="vb" AutoEventWireup="false" Codebehind="WebUserControl1.ascx.vb" Inherits="CustomAuthenticationDemo2003.WebUserControl1" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<table height="100%" width="100%" bgcolor="#33ff33">
<tr>
<td>
Woof
</td>
</tr>
</table>
Would that do it?
Woka
Re: Forcing usercontrol height to equal placeholder height?
Thanks for the suggestions
I've been messing around with the layout of my page. Basically i just set the height of the table containing the placeholders to 100%. And instead of setting the background appearance of the usercontrols, I am now doing this to the table cells containing the placeholders. So it no longer matters what the height of the usercontrol is.
thanks again,
:D