Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 300785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:56:45+00:00 2026-05-12T06:56:45+00:00

I am using DataList control to show three products per line horizontally. But there

  • 0

I am using DataList control to show three products per line horizontally. But there is layout problem and it pushes up the product image container element like the below :

Data List Layout problem http://www.pixelshack.us/images/wwmlzkvhxsr7b2l0ptcl.jpg

Here is the code :

  <asp:DataList ID="dlProducts" runat="server" RepeatColumns="3" RepeatLayout="Table"
                DataSourceID="ObjectDataSourceCategories" RepeatDirection="Horizontal" CellSpacing="10" CellPadding="0" HorizontalAlign="Center" ItemStyle-Wrap="true">
                <ItemTemplate>

                        <a href='<%# "Items.aspx?catId=" + (string)Eval("id") %>'>
                            <asp:Image ID="Image1" CssClass="photo-border photo-float-left" runat="server" Width="165px"
                                Height="120px" ImageUrl='<%# "ProductImages/Thumbnails/" + (string)Eval("ImageUrl") %>'
                                AlternateText='<%#(string)Eval("ImageAltText")%>' /></a>
                        <br />
                        <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%# "Items.aspx?catId=" + (string)Eval("id") %>'
                            Text='<%# Eval("Title").ToString()%>' Font-Bold="true" />
                </ItemTemplate>
            </asp:DataList>

How can I get over the problem ?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T06:56:46+00:00Added an answer on May 12, 2026 at 6:56 am

    I was having a similar issue. I ended up having to break the linked image and and text into their own div and style them accordingly:

    <ItemTemplate>
        <div class="outer">
            <div class="top">
                <asp:HyperLink id="hlImage" runat="server" CssClass="Font7">
                </asp:HyperLink>
            </div>
            <div class="bottom">
                <asp:Label id="lbText" runat="server" CssClass="Font7"></asp:Label>
            </div>
        </div>
    </ItemTemplate>
    

    I’m sure there are cleaner ways to do this and this is just example of what the HTML output might look like. This is just “off the cuff” but if you put in an empty htm file it will display.

    <div style="width: 100px;">
        <!-- first row -->
        <div style="float:left; width:50px; border: 2px solid black;">
            <div>
                <a href="#">link</a>
            </div>
            <div style="height:50px; background-color:Aqua; vertical-align:bottom;">
                <span>text</span>
            </div>
        </div>
        <div style="float:left; width:50px; border: 2px solid black;">
            <div>
                <a href="#">link</a>
            </div>
            <div style="background-color: Aqua;">
                <span style="height:50px; vertical-align:bottom;">text</span>
            </div>
        </div>
        <!-- second row -->
        <div style="float:left; width:50px; border: 2px solid black;">
            <div>
                <a href="#">link</a>
            </div>
            <div style="height:50px; background-color:Aqua; vertical-align:bottom;">
                <span>text</span>
            </div>
        </div>
    </div>
    

    You can most likely use RepeatLayout=”Flow” ItemStyle=”float:left;” in your DataList control to help as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Am using a datalist to show the product details. In this time i want
How to get clientID of Datalist control using jquery , I tried using the
I am using datalist to display data from the database,I have got three fields
I'm using a datalist control. How I can add a row separator in the
I have a problem on using RequiredField Validator for CheckBoxList inside Datalist. I am
i doing asp.net and using vb.net. I have a datalist control which inside it
Is it possible to access controls inside EditItemTemplate of Datalist control using jquery. I
I am using datepicker to select date in datalist control in asp.net. The scenario
I have a datalist control where there are one checkbox in each ItemTamplate. Along
I am using a DataList to render some divs in table layout and RepeatColumn

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.