添加图片到在asp.net中的链接按钮 [英] Add image to a link button in asp.net

查看:106
本文介绍了添加图片到在asp.net中的链接按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<asp:GridView ID="Grid_Organisationtable" runat="server"  CssClass="string"
             SelectedIndex="0" DataKeyNames="OrganisationID"
            ShowHeaderWhenEmpty="True" OnRowDeleting="Grid_Organisationtable_RowDeleting" OnRowEditing="Grid_Organisationtable_RowEditing"
            AutoGenerateColumns="false" Height="95px" Width="492px">     
<Columns>
                   <asp:TemplateField HeaderText="Edit Controls" ItemStyle-Width="15%">
                        <ItemTemplate>
                            <asp:ImageButton ImageUrl="~/Styles/Images/Edit.jpg" CommandName="Edit" runat="server"
                                ID="btn_Edit" ToolTip="Edit Organisation" />
     <asp:LinkButton ID="LinkButton1" CommandArgument='<%# Eval("OrganisationID") %>' CommandName="Delete" runat="server">delete</asp:LinkButton>
     </ItemTemplate>
                        <ItemStyle Width="15%" />
                    </asp:TemplateField>

我有在网格视图中的链接按钮从网格中删除一行,我想一个图像添加到链接按钮,而不是文字删除。我如何添加图像链接按钮。我不想使用图像按钮。谢谢你。

I am having a link button in the grid view to delete a row from the grid, I want to add a image to the link button instead of the text delete. how can I add image to the link button. I dont want to use image button. Thanks.

推荐答案

将一个标签之间的

<asp:LinkButton>

</asp:LinkButton>

标签,就像你一个正常的超链接。

tags, just like you would a normal hyperlink.

 <asp:LinkButton ID="LinkButton1" CommandArgument='<%# Eval("OrganisationID") %>' CommandName="Delete" runat="server"><img src="pathtoimage.jpg" alt="delete group" />delete</asp:LinkButton> 

这篇关于添加图片到在asp.net中的链接按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆