我正在使用 gridview 来显示数据,并且在 gridview 本身中我有一些操作按钮,例如编辑删除和预览图片视图。但我不想在我的预览按钮上显示文本“预览”,我想要(fontawesome 图标)而不是文本(预览)。我的代码在这里....
<asp:GridView ID="GVProduct" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CssClass="table table-bordered table-sm table-hover table-striped" EmptyDataText="No rows for the selection criteria." EnableTheming="False" PageSize="5" OnRowCommand="grdForRows_RowCommand" OnPageIndexChanging="grdForRows_PageIndexChanging">
<Columns>
<asp:BoundField DataField="ProId" HeaderText="Prod.Id">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField DataField="ProName" HeaderText="Product Name">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="ProCategory" HeaderText="Category">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:ButtonField Text="Preview" ButtonType="Button" HeaderText="Photo" CommandName="btnPreview">
<ControlStyle CssClass="btn btn-success btn-sm" />
</asp:ButtonField>
<asp:ButtonField Text="Edit" ButtonType="Button" CommandName="btnEdit">
<ControlStyle CssClass="btn btn-primary btn-sm" />
</asp:ButtonField>
<asp:ButtonField ButtonType="Button" CommandName="btnDelete" Text="Delete">
<ControlStyle CssClass="btn btn-danger btn-sm" />
</asp:ButtonField>
</Columns>
我要在按钮上添加的图标的代码是
<i class="fas fa-eye"></i>