|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
visibly disable img linkHi;
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 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. Hi;
That's what I thought - but figured I should ask in case ASP had some better solution. -- Show quoteHide quotethanks - dave david_at_windward_dot_net http://www.windwardreports.com Cubicle Wars - http://www.windwardreports.com/film.htm "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. > > 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.
only for expert: what's wrong with this code?
ButtonField and Eval Enabling Windows Authentication from inside Forms Authentication (ASP.NET 2.0) How do I get a bitmap from the theme? Visual Development of Web Controls for SharePoint Can a repeater's ItemTemplate instantiate derived classes? extending web controls possible calendar bug Help on java script navigator for database available? |
|||||||||||||||||||||||