[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1302
  • Last Modified:

asp.net ImageButton ImageUrl

Can you set the ImageUrl path in an asp:Image Button like
<asp:ImageButton ImageUrl='<%= MyClass.MyPathToMyImage%>' />

0
Paulconsulting
Asked:
Paulconsulting
  • 2
1 Solution
 
Todd GerbertIT ConsultantCommented:
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
0
 
PaulconsultingAuthor Commented:
Thanks
0
 
PaulconsultingAuthor Commented:
thanks
0
 
BillsnowCommented:
Can you concantenate the ImageUrl?

Example:
<asp:ImageButton ID="ClientButton"
ImageUrl='http://MyImageStore.com/images/<%# Eval("BlobGUID"%>'
runat="server" width="75px" />

or... ???

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

0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now