数据库中用一个字段来代表其应该使用的图标类型。DataGrid 中用一个Label控件来包含显示图片的 html <asp:label id=imagelabel runat=server><img src='<%# GetImageName(container.dataitem("imagetype") %>'></asp:label>code behind中定义一个函数:    Public Function GetImageName(ByVal img As Object) As String
        If img Is DBNull.Value Then
            Return "file.gif"
        Else
           If img.ToString() = "dir" then
              Return "dir.gif"
           else
              Return "file.gif"
           end if
        End If
    End Function