我应该使用哪个属性或方法将 ToolTip 属性绑定到 ImageField 类?
在绑定在 GridView 列内的图像控件中,我可以使用 DataAlternateTextField
属性设置 Alt 文本属性。
<asp:ImageField DataImageUrlField="Flag"
DataImageUrlFormatString="~/images/f/{0}.png"
DataAlternateTextField="Description" >
</asp:ImageField>
这会导致类似...
<img src="1.png" alt="Alt text"/>
我应该使用哪个属性或方法来绑定 ToolTip 属性?
<img src="1.png" alt="Alt text" ToolTip="Title text" />
我希望网站的用户将鼠标悬停在图像上时能够读取标题属性。
In an image control that is bound within a GridView column i can set the Alt text property by using the DataAlternateTextField
property.
<asp:ImageField DataImageUrlField="Flag"
DataImageUrlFormatString="~/images/f/{0}.png"
DataAlternateTextField="Description" >
</asp:ImageField>
which results in somathing like...
<img src="1.png" alt="Alt text"/>
Which property or method should i use to bind the ToolTip property?
<img src="1.png" alt="Alt text" ToolTip="Title text" />
I would like the users of the website, on mouse hovering of the image, to be able to read the title property.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于所有像我一样的新手,这是我所做的
谢谢维罗妮卡
To all newbies out there just like me, here what i did
Thanks Veronica
您可以使用绑定表达式来设置 ImageField 的标题。 http://msdn.microsoft.com/en-us/library/ms178366.aspx
You can use binding expression to set the title of the ImageField. http://msdn.microsoft.com/en-us/library/ms178366.aspx
我现在正在根据 Microsoft,ImageField 的备用文本属性也应该转换为工具提示。至少我刚刚链接的 msdn 页面上是这么说的。
I am playing with this issue now according to Microsoft, the alternate text property of an ImageField should translate into a tooltip as well. At least that's what it says on the msdn page i just linked.