asp.net 2.0
I have a Panel on my webpage. Within this Panel is a Label control which
displays text over several rows...
I just tested this and when running the webpage with a lot of data in the
label control -The label control writes pass the Panel control.
I want the Panel to extend it's height automically if the height of it's
content is higher than the Panel orginally can display.
Here are some of my settigns for the Panel control;
ID="Panel1" runat="server" Height="100%"
I also tryed using Height="500px"; without any luck
Any suggestions to this?Hi Jeff.
The panel control renders as a div element on the HTML page. Consequently,
assigning the height attribute isn't going to impact the display.
For better control, you might want to nest the label control inside a table.
You can use the table to better manage the presentation. You could also
attach a CSS class to the panel -- in fact, that's probably the cleanest
solution.
When I first got started using ASP.NET, I used the label control everywhere.
As you get more comfortable with the built-in controls, you'll likely want to
gravitate toward a GridView for presentation of database fields or one of the
other controls that is better suited for this amount of data.
Good luck.
-Brenden
"Jeff" wrote:
Quote:
Originally Posted by
hey
>
asp.net 2.0
>
I have a Panel on my webpage. Within this Panel is a Label control which
displays text over several rows...
I just tested this and when running the webpage with a lot of data in the
label control -The label control writes pass the Panel control.
>
I want the Panel to extend it's height automically if the height of it's
content is higher than the Panel orginally can display.
>
Here are some of my settigns for the Panel control;
ID="Panel1" runat="server" Height="100%"
I also tryed using Height="500px"; without any luck
>
Any suggestions to this?
>
>
>
I agree and have one thing to add for newbies.
Often people want to use a panel becuase its border defaults to a nice thin
border while a table is not as slick at default.
However the following makes a nice thin border
<table width="100%" style="border: 1px solid; border-color:DarkBlue"
border="0" cellpadding="0" cellspacing="0" >
"Brenden Bixler" wrote:
Quote:
Originally Posted by
Hi Jeff.
>
The panel control renders as a div element on the HTML page. Consequently,
assigning the height attribute isn't going to impact the display.
>
For better control, you might want to nest the label control inside a table.
You can use the table to better manage the presentation. You could also
attach a CSS class to the panel -- in fact, that's probably the cleanest
solution.
>
When I first got started using ASP.NET, I used the label control everywhere.
As you get more comfortable with the built-in controls, you'll likely want to
gravitate toward a GridView for presentation of database fields or one of the
other controls that is better suited for this amount of data.
>
Good luck.
>
-Brenden
>
"Jeff" wrote:
>
Quote:
Originally Posted by
hey
asp.net 2.0
I have a Panel on my webpage. Within this Panel is a Label control which
displays text over several rows...
I just tested this and when running the webpage with a lot of data in the
label control -The label control writes pass the Panel control.
I want the Panel to extend it's height automically if the height of it's
content is higher than the Panel orginally can display.
Here are some of my settigns for the Panel control;
ID="Panel1" runat="server" Height="100%"
I also tryed using Height="500px"; without any luck
Any suggestions to this?
Thanks, I'm trying your CSS suggestion:
However I got some problems getting this to work, "height:100%" isn't
working. The text still writes pass the Panel control.
Here are more info
..profile_info
{
height:100%;
background-color:Green;
color:Red;
}
(I use green and red colors to test if the page actually reads the CSS
styles, and Yes the green and red color works. But the height have no
effect...)
Part of MasterPage.master
<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">
</asp:ContentPlaceHolder>
</asp:Panel>
Part of Default.aspx:
<asp:Label ID="lblInfo" runat="server" Height="14px" Style="z-index: 107;
left: 5px;
position: absolute; top: 232px" Width="589px"></asp:Label>
The ContentPlaceHolder and the Panel is placed on a master page. And
Default.aspx are using this master page. The Label control is on the
Default.aspx file
I would prefer to use CSS instead of table....
Any suggestions?
jeff
"Brenden Bixler" <BrendenBixler@.discussions.microsoft.comwrote in message
news:55887EF0-3A6E-4446-8FCD-D1765F332A11@.microsoft.com...
Quote:
Originally Posted by
Hi Jeff.
>
The panel control renders as a div element on the HTML page. Consequently,
assigning the height attribute isn't going to impact the display.
>
For better control, you might want to nest the label control inside a
table.
You can use the table to better manage the presentation. You could also
attach a CSS class to the panel -- in fact, that's probably the cleanest
solution.
>
When I first got started using ASP.NET, I used the label control
everywhere.
As you get more comfortable with the built-in controls, you'll likely want
to
gravitate toward a GridView for presentation of database fields or one of
the
other controls that is better suited for this amount of data.
>
Good luck.
>
-Brenden
>
"Jeff" wrote:
>
Quote:
Originally Posted by
>hey
>>
>asp.net 2.0
>>
>I have a Panel on my webpage. Within this Panel is a Label control which
>displays text over several rows...
>I just tested this and when running the webpage with a lot of data in the
>label control -The label control writes pass the Panel control.
>>
>I want the Panel to extend it's height automically if the height of it's
>content is higher than the Panel orginally can display.
>>
>Here are some of my settigns for the Panel control;
>ID="Panel1" runat="server" Height="100%"
>I also tryed using Height="500px"; without any luck
>>
>Any suggestions to this?
>>
>>
>>
If i understand what you want correctly if you want a panel to grow and
shrink given the amount of information you have you are better off not using
a panel at all but rather a table.
Second thing to keep in the back of your mind most controls have issues with
Height=100%. The reason for this is becuase in theory a web browser has an
infinite height becuase it has a scroll bar so the controls basically wonder
"how far is 100% anyway?"
In short, for autogrow/shrink solutions the best solutions are div's and
tables.
Now if you need server side control over your tables you can do that however
that is a different subject.
"Jeff" wrote:
Quote:
Originally Posted by
Thanks, I'm trying your CSS suggestion:
>
However I got some problems getting this to work, "height:100%" isn't
working. The text still writes pass the Panel control.
>
Here are more info
..profile_info
{
height:100%;
background-color:Green;
color:Red;
}
(I use green and red colors to test if the page actually reads the CSS
styles, and Yes the green and red color works. But the height have no
effect...)
>
Part of MasterPage.master
<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">
</asp:ContentPlaceHolder>
</asp:Panel>
>
Part of Default.aspx:
<asp:Label ID="lblInfo" runat="server" Height="14px" Style="z-index: 107;
left: 5px;
position: absolute; top: 232px" Width="589px"></asp:Label>
>
>
The ContentPlaceHolder and the Panel is placed on a master page. And
Default.aspx are using this master page. The Label control is on the
Default.aspx file
>
I would prefer to use CSS instead of table....
>
Any suggestions?
>
jeff
>
>
>
"Brenden Bixler" <BrendenBixler@.discussions.microsoft.comwrote in message
news:55887EF0-3A6E-4446-8FCD-D1765F332A11@.microsoft.com...
Quote:
Originally Posted by
Hi Jeff.
The panel control renders as a div element on the HTML page. Consequently,
assigning the height attribute isn't going to impact the display.
For better control, you might want to nest the label control inside a
table.
You can use the table to better manage the presentation. You could also
attach a CSS class to the panel -- in fact, that's probably the cleanest
solution.
When I first got started using ASP.NET, I used the label control
everywhere.
As you get more comfortable with the built-in controls, you'll likely want
to
gravitate toward a GridView for presentation of database fields or one of
the
other controls that is better suited for this amount of data.
Good luck.
-Brenden
"Jeff" wrote:
Quote:
Originally Posted by
hey
>
asp.net 2.0
>
I have a Panel on my webpage. Within this Panel is a Label control which
displays text over several rows...
I just tested this and when running the webpage with a lot of data in the
label control -The label control writes pass the Panel control.
>
I want the Panel to extend it's height automically if the height of it's
content is higher than the Panel orginally can display.
>
Here are some of my settigns for the Panel control;
ID="Panel1" runat="server" Height="100%"
I also tryed using Height="500px"; without any luck
>
Any suggestions to this?
>
>
>
>
>
>
0 comments:
Post a Comment