combine text to databinder.eval(container.dataitem,"fieldname" gives me an error

Posted on 2011-05-04
Last Modified: 2012-05-11
I need to combine the file name that is in the datasource to which the control is bound to and prefix it with the path "images/category".
 <img alt='Category2' src='<% #String.Format("/Images/category/",  DataBinder.Eval(Container.DataItem, "ImageName") %>'
                                    style="width:30px;height:30px;border:none;vertical-align:middle;float:left;" />

I tried to do it using string.format and get the error: :
BC30248: 'If', 'ElseIf', 'Else', 'End If', 'Const', or 'Region' expected.

Please suggest how I can specify the src for the image. Thanks

Question by:TrialUser
    LVL 8

    Accepted Solution

    What about String.Concat?

    Author Closing Comment


    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

    Join & Write a Comment

    Suggested Solutions

    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
    In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
    In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…

    733 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

    17 Experts available now in Live!

    Get 1:1 Help Now