?
Solved

ASP.NET: Change ImageURL on Imagebutton

Posted on 2008-11-06
2
Medium Priority
?
670 Views
Last Modified: 2013-11-07
Hi All,

I've searched extensively, but have not come up with a solution for this.

I am using a standard ImageButton on my webform and would simply like to change the image when the ImageButton is enabled or disabled.

I've looked into extending or creating a new web control based on this, but my version of Viual Studio 2005 does not seem to have a Web Controls Library template.

Is there any other way to accomplish this?

Thx!
0
Comment
Question by:knuckle05
2 Comments
 
LVL 20

Expert Comment

by:Juan_Barrera
ID: 22900485
Hi!

How do you enable / disable the imageButton? Using javascript or via server-side code?
0
 
LVL 13

Accepted Solution

by:
sm394 earned 1200 total points
ID: 22900516
just put this check

if(imgbtn.Enabled)
imgbtn.ImageUrl="imageOn.gif";
else
imgbtn.ImageUrl="imageOFF.gif";
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month15 days, 6 hours left to enroll

840 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