• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 674
  • Last Modified:

ASP.NET: Change ImageURL on Imagebutton

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
knuckle05
Asked:
knuckle05
1 Solution
 
Juan_BarreraCommented:
Hi!

How do you enable / disable the imageButton? Using javascript or via server-side code?
0
 
sm394Commented:
just put this check

if(imgbtn.Enabled)
imgbtn.ImageUrl="imageOn.gif";
else
imgbtn.ImageUrl="imageOFF.gif";
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

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