【发布时间】:2013-11-04 13:57:25
【问题描述】:
我在 ListView 中有一个动态生成的 ImageButtons,在 ItemDataBound 中,如果图像没有链接,我需要将其禁用,我尝试了以下方法,
img.Enabled = False
img.DescriptionUrl = "javascript:void(0);"
img.PostBackUrl = "javascript:void(0);"
img.CssClass = "imageButtonClass"
img.Style.Add(HtmlTextWriterStyle.Cursor, "pointer")
CSS:
.imageButtonClass
{
cursor:pointer;
}
这使得目标图像在所有浏览器中都被禁用,但是,光标仅在 IE 中变为指针。不在 Firefox 和 Chrome 中! 有什么建议吗?
【问题讨论】:
-
图像按钮默认应该有 cursor:pointer。您可以在 jsfiddle.net 上为按钮发布一些呈现的 HTML 以显示问题吗?
标签: html asp.net css cursor imagebutton