Wrap text around image in datalist

Posted on 2007-07-30
Last Modified: 2009-02-23
Hello. I have a datalist which contains a hyperlink with an imageURL and a label control. Both controls get their data from a sqldatasource. Currently the image is displayed and then on the next line the text is displayed.

I need to know how to wrap the text around the image... How can I accomplish this task?

Here is my code:

            <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1">
                    <asp:HyperLink ID="HyperLink1" NavigateUrl="~/Default.aspx" ImageUrl='<%# Eval("pictureURL") %>'
                        runat="server">Waterfall</asp:HyperLink><br />
                    <asp:Label ID="textLabel" runat="server" Text='<%# Eval("text") %>'></asp:Label>
            </asp:DataList><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:testingConnectionString %>"
                SelectCommand="SELECT [pictureURL], [text] FROM [imageWrap]"></asp:SqlDataSource>
Question by:gogetsome
    1 Comment
    LVL 25

    Accepted Solution

    You can do this using CSS:

    CSS Image Text Wrap

    CSS Image Text Wrap Part 2


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now