Solved ImageButton ImageUrl

Posted on 2009-02-19
Last Modified: 2012-05-06
Can you set the ImageUrl path in an asp:Image Button like
<asp:ImageButton ImageUrl='<%= MyClass.MyPathToMyImage%>' />

Question by:Paulconsulting
    LVL 33

    Accepted Solution

    Almost... I think you should be able to do that with <asp:ImageButton ImageUrl='<%# MyClass.MyPathToMyImage %>' />

    The <%# %> is a data-binding syntax.

    You would also be able to do it in code-behind user ImageButton1.ImageUrl = MyClass.blahblahblah

    Author Closing Comment


    Author Comment


    Expert Comment

    Can you concantenate the ImageUrl?

    <asp:ImageButton ID="ClientButton"
    ImageUrl='<%# Eval("BlobGUID"%>'
    runat="server" width="75px" />

    or... ???

    I've tried various combinations but can't get it to produce the right code.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
    For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    737 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

    18 Experts available now in Live!

    Get 1:1 Help Now