因为我正在编辑一条记录,因为它在Internet Explorer中完美运行,我使用编辑模板中的EditText属性设置了用于编辑的工具提示,同样也用于更新文本。现在它正在IE中按预期呈现,但它没有在firefox中显示工具提示, 功能明智,工作正常。
<asp:CommandField ButtonType="Image" EditText="Click here to edit section" EditImageUrl="../images/edit.gif" HeaderText="Actions"
UpdateText="click here to update section" UpdateImageUrl="../images/pageok.gif" CancelText="Cancel"
CancelImageUrl="../images/pagecancel.gif" ShowEditButton="true"
ControlStyle-CssClass="LinkNormal" >
答案 0 :(得分:0)
我不知道为什么它在FireFox中不起作用。在RowDataBound事件期间,您可以尝试以编程方式修改单元格或CommandField控件之一的ToolTip属性:
protected void gv_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[column_index].ToolTip = "Click here to edit section"; // for cell
((ImageButton)e.Row.Cells[column_index].Controls[control_index]).ToolTip = "Click here to edit section"; // for ImageButton
}
}
示例假设您已转换为ImageButton。
答案 1 :(得分:0)
您还可以使用项目模板和编辑项目模板来实现此目的。这更灵活。
答案 2 :(得分:0)