newbie: autosize

J

Jeff

Hey

asp.net 2.0

I've read (asp.net 2.0 documentation) that the Panel control in asp.net 2.0
supports a AutoSize property and a AutoSizeMode. I've checked in the my
property page of the Panel control on my webpage and I cannot find these
properties.... So how to I set the values of these properties?

Best Regards

Jeff
 
S

Steve C. Orr [MVP, MCSD]

The WINDOWS FORMS panel control supports these properties, but not the
ASP.NET version of the control.
You can get a similar effect in ASP.NET by clearing the width and height
properties of the panel.
 
J

Jeff

Thanks, I just a got a question related to your post:

I have another master page (masterpage.master) and webpage where in the
webpage (lets call it default.aspx) contains a label control. During runtime
this label control gets many rows of data (it get it's value from the
database, and the value contains many <BR/>).... This label control is
placed in the default.aspx in the ContentPlaceHolder named "content" (see
below)... But the Panel (see below) doesn't grow to fit the size of it's
controls. The Label control writes data pass the panel border. Check this
link: http://home.online.no/~au-holme/pub/66303/autosize.PNG at this link
you see the label control has a green background... it writes pass the panel
and continues to writes on the Document... But I want the panel to shrink &
grow according to it's content...

Master page :
<asp:panel ID="Panel1" runat="server" Style="z-index: 100; left: 165px;
position: absolute; top: 107px" Width="602px" CssClass="profile_info">
<asp:ContentPlaceHolder ID="content" runat="server">
&nbsp;</asp:ContentPlaceHolder>
</asp:panel>
<asp:panel ID="Panel2" runat="server" Height="649px" Style="z-index: 101;
left: 3px;
position: absolute; top: 109px" Width="156px">
<asp:ContentPlaceHolder ID="sidebar" runat="server">
</asp:ContentPlaceHolder>
</asp:panel>

..profile_info
{
height:100%;
background-color:Green;
color:Red;
}

This is the label control in default.aspx:
<asp:Label ID="lblInfo" runat="server" Style="z-index: 107; left: 5px;
position: absolute; top: 232px" Width="589px"></asp:Label>

Any suggestions to how I can make this panel shrink & grow to fit it's
contents?

Jeff
 

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

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top