Solved

Change the image of boundfield buttontype="image"

Posted on 2010-09-07
2
609 Views
Last Modified: 2013-12-17
I have the below code, how can I change the default image of the boundfield programmatically?
<columns>

               <asp:buttonfield buttontype="Image" commandname="Resume" ImageUrl="http://vmsd3jooc01/sites/applicantmanagement/PublishingImages/icons/attachmenticon.png" />

               </columns>

Open in new window

0
Comment
Question by:PagodNaUtak
2 Comments
 
LVL 12

Expert Comment

by:w00te
ID: 33623853
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.buttonfield.imageurl.aspx
public virtual string ImageUrl { get; set; }
Just set:
your_object_name.ImageUrl = "yourimagestringgoeshere.jpg";
anywhere in your C# code that has access to that element.
-w00te
0
 
LVL 8

Accepted Solution

by:
PagodNaUtak earned 0 total points
ID: 33625126
What my problem is how can I refference the object ButtonField since you cannot add an ID to it...
So to solve my problem I do the code below:

ImageButton imgResume = (ImageButton)e.Row.Cells[1].Controls[0];



imgResume.ImageUrl = "http://vmsd3jooc01/sites/applicantmanagement/PublishingImages/icons/null.bmp"; 

Open in new window

0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
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…

759 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

21 Experts available now in Live!

Get 1:1 Help Now