【问题标题】:GridView ImageField With Text带有文本的 GridView ImageField
【发布时间】:2010-12-23 10:00:24
【问题描述】:

我有一个 ASP.Net GridView,我想在同一个字段中包含一个图像和一个文本,如下所示:

<a id="lnkForJQueryCall"><img src="whatever.png"> Some Other Number</a>

我发现asp:ImageField没有在图片左右添加文字的属性,也没有太多选择,有什么办法可以实现吗?

[编辑] 我正在考虑一个 css 类的解决方法,但还没有弄清楚如何去做!

【问题讨论】:

    标签: asp.net gridview image


    【解决方案1】:

    您可以使用TemplateFieldGridView 等数据绑定控件中显示自定义内容。

    <asp:TemplateField>
        <ItemTemplate>
            <a id="lnkForJQueryCall"><img src="whatever.png"> Some Other Number</a>
        </ItemTemplate>
    </asp:TemplateField>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多