Surya sasidhar
Surya sasidhar

Reputation: 30343

Datalist control in asp.net

in my web application, I am using datalist, in that i am displaying images and below that i am displaying name of that image. I am displaying images in horizontal and display 5 images for a row. My problem is due to the long length of the image name the space between cells are huge. Can we display the name in second line.

Please help if u do not understand my problem tell me I will explain once again.

this is source code

<asp:DataList ID="DataList1" RepeatColumns="9" RepeatDirection="Horizontal" 
     runat="server" Width="719px" >
   <ItemTemplate>
     <center>
       <img src='AlumniGallery/compressed/<%# Eval("Photoname")%>' id="img1" 
           width="75px" height="85px"/><br />           
       <asp:LinkButton ID="LinkButton1" ForeColor="black" CssClass="xyz" 
           Width="165px" CommandArgument='<%# Eval("Photoname")%>'  
           CommandName='<%# Eval("slno")%>' runat="server" 
           OnCommand="LinkButton2_Command"><%# Eval("name")%></asp:LinkButton>
     </center> </ItemTemplate>
</asp:DataList>

Upvotes: 0

Views: 966

Answers (1)

TheVillageIdiot
TheVillageIdiot

Reputation: 40537

try using this:

  <ItemStyle Width="100px" Wrap="true" /> //this will limit width of the 
                                          //item and wrap long text
  <ItemTemplate>

Upvotes: 1

Related Questions