Saturday, March 24, 2012

Text overflow in Div

Hi guys

Am new to asp.net. I am tryin to display some information from database into a label element , issue is the text gets overflow rather wrapping within the element(as in notepad).

any help/advice much appreciated

-->

<divid="columnright">

<divclass="rightblock">

<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:SwapNetDB %>"

SelectCommand="SELECT id, itemdate, title, description, photo, albumid, staticURL FROM Announcements WHERE (id = @dotnet.itags.org.id)">

<SelectParameters>

<asp:ParameterType="Int32"DefaultValue="1"Name="id"></asp:Parameter>

</SelectParameters>

</asp:SqlDataSource>

<asp:FormViewID="FormView1"runat="server"DataSourceID="SqlDataSource1"DataKeyNames="id"

OnDataBound="FormView1_DataBound">

<ItemTemplate>

<h3>

<asp:LabelHeight="100px"Text='<%# Eval("title") %>'runat="server"ID="titleLabel"/>

</h3>

<divclass="itemdetails">

<p>

<asp:LabelText='<%# Eval("itemdate","{0:D}") %>'runat="server"ID="itemdateLabel"/>

</p>

</div>

<p>

<asp:labelBorderStyle="None"BackColor="transparent"Text='<%# Eval("description") %>'runat="server"ID="descriptionLabel"/>

</p>

</ItemTemplate>

</asp:FormView>

ID="LinkButton4"runat="server"OnClick="prevButton_Click">« Previous Article</asp:LinkButton>

</div>

</div>

Css info:

.leftblock

{

border:1pxsolid#DBDB79;

padding:15px;

margin-bottom:10px;

background:#FEFAABurl(../../images/background_columnleft.gif)repeat-y;

vertical-align:top;

}

.leftblockh2,.rightblockh2,.fullwidthh2

{

font-size:1.6em;

}

#columnleft

{

float:left;

width:240px;

/*position: relative; */

}

#columnright

{

margin-left:245px;width:446px ;

/*position: relative; */

}

.rightblock

{

border:1pxsolid#DBDB79;

padding:0px;

margin-bottom:1px;

margin-right:1px;

background:#FEFFABurl(../../images/background_columnright.gif)repeat-y;position:relative;

}

any help much appreciated

Labels render as an html <span> element. Apply a width to it.

0 comments:

Post a Comment