【问题标题】:asp:GridView ImageField DataImageUrlField - specifying multiple fields?asp:GridView ImageField DataImageUrlField - 指定多个字段?
【发布时间】:2011-02-08 15:36:12
【问题描述】:

我知道我可以为此使用asp:TemplateField,但是在 asp:GridView 中使用标准 asp:BoundField 或 asp:ImageField,是否可以指定多个字段并在 FormatString 字段中将它们用作 {0} { 1} {2} 等...

例如

<asp:ImageField DataImageUrlField="ProfileImageId,UserGuid" DataImageUrlFormatString="img-profile.ashx?uid={0}&pid={1}" />

我一直在思考这个问题。这会比使用asp:TemplateField 更简洁

【问题讨论】:

    标签: asp.net gridview webforms


    【解决方案1】:

    HyperlinkField 可以使用多个字段来格式化 url,但您不能对其他 *Field 列执行此操作。

    【讨论】:

    • 谢谢,那我猜它做不到。傻,是这样一个有用的功能。想知道为什么 MS 这样做
    猜你喜欢
    • 2023-03-28
    • 1970-01-01
    • 2012-10-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-12
    相关资源
    最近更新 更多