Home All Groups Group Topic Archive Search About
Author
30 Oct 2006 5:43 AM
David Thielen
Hi;

We have image links via ButtonField and when it is disabled, the link does
not work but the image looks the same. Any suggestions to make the image look
disabled?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm

Author
30 Oct 2006 12:45 PM
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.
Author
30 Oct 2006 4:24 PM
David Thielen
Hi;

That's what I thought - but figured I should ask in case ASP had some better
solution.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




Show quoteHide quote
"Steven Cheng[MSFT]" wrote:

> 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.
>
>
Author
31 Oct 2006 3:03 AM
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.