Results 1 to 4 of 4

Thread: [Resolved] Forcing usercontrol height to equal placeholder height?

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Location
    Cape Town, RSA
    Posts
    11

    [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
    Last edited by muri; Jul 17th, 2005 at 10:34 AM.

  2. #2
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131

    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

    If I have been helpful please rate my post. If I haven't tell me!

  3. #3
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    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

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Location
    Cape Town, RSA
    Posts
    11

    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,


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width