visibly disable img link

S

Steven Cheng[MSFT]

Hi Dave,

As for the ImageButton it is rendered as <input type="image" src="...."
/>, when you set its "Enabled=false", it is rendered as

<input type="image" disabled="disabled" .../>

And the image will still display as normal, it is only the postback/submit
behavior that will be disabled. If you want to make the button also
display the image like a disabled one(masked), you need to change the
imagebutton's url to another image (has the picture look as disabled one).

e.g.

if(imageButton.Enabled == false)
{
imageButton.Src = "disabled image url";
}

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Steven Cheng[MSFT]

Thanks for your reply Dave,

So far ASP.NET server control also provide the same disable behavior as
HTML element.

Please feel free to let me know if you have any other questions or ideas on
this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top