ImageField.DataImageUrlField プロパティ
アセンブリ: System.Web (system.web.dll 内)

Dim instance As ImageField Dim value As String value = instance.DataImageUrlField instance.DataImageUrlField = value
/** @property */ public String get_DataImageUrlField () /** @property */ public void set_DataImageUrlField (String value)
public function get DataImageUrlField () : String public function set DataImageUrlField (value : String)
ImageField オブジェクトの各イメージの ImageUrl プロパティにバインドするフィールドの名前。

ImageField オブジェクトの各イメージの ImageUrl プロパティにバインドするフィールド名を指定するには、DataImageUrlField プロパティを使用します。指定するフィールドには、ImageField オブジェクトに表示するイメージの URL が格納されている必要があります。DataImageUrlFormatString プロパティを設定することにより、URL 値に書式を適用することもできます (省略可能)。
![]() |
---|
フィールド値が null 参照 (Visual Basic では Nothing) の場合、イメージは表示されません。null 参照 (Visual Basic では Nothing) のフィールド値に対して代替イメージを表示するには、NullImageUrl プロパティを設定します。代替イメージではなく、代替テキストが表示されるようにするには、NullDisplayText プロパティを設定します。 |

DataImageUrlField プロパティを使用して、ImageField オブジェクトの各イメージの ImageUrl プロパティにバインドするフィールド名を指定する方法を次のコード例に示します。
<%@ Page language="VB" %> <html> <body> <form runat="server"> <h3>ImageField Example</h3> <asp:gridview id="EmployeesGrid" autogeneratecolumns="false" datasourceid="EmployeeSource" runat="server"> <columns> <asp:imagefield dataimageurlfield="LastName" dataimageurlformatstring="~\Images\{0}.jpg" alternatetext="Employee Photo" nulldisplaytext="No image on file." headertext="Photo" readonly="true"/> <asp:boundfield datafield="FirstName" headertext="First Name"/> <asp:boundfield datafield="LastName" headertext="Last Name"/> </columns> </asp:gridview> <!-- This example uses Microsoft SQL Server and connects --> <!-- to the Northwind sample database. Use an ASP.NET --> <!-- expression to retrieve the connection string value --> <!-- from the Web.config file. --> <asp:sqldatasource id="EmployeeSource" selectcommand="Select [EmployeeID], [LastName], [FirstName] From [Employees]" connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" runat="server"/> </form> </body> </html>
<%@ Page language="C#" %> <html> <body> <form runat="server"> <h3>ImageField Example</h3> <asp:gridview id="EmployeesGrid" autogeneratecolumns="false" datasourceid="EmployeeSource" runat="server"> <columns> <asp:imagefield dataimageurlfield="LastName" dataimageurlformatstring="~\Images\{0}.jpg" alternatetext="Employee Photo" nulldisplaytext="No image on file." headertext="Photo" readonly="true"/> <asp:boundfield datafield="FirstName" headertext="First Name"/> <asp:boundfield datafield="LastName" headertext="Last Name"/> </columns> </asp:gridview> <!-- This example uses Microsoft SQL Server and connects --> <!-- to the Northwind sample database. Use an ASP.NET --> <!-- expression to retrieve the connection string value --> <!-- from the Web.config file. --> <asp:sqldatasource id="EmployeeSource" selectcommand="Select [EmployeeID], [LastName], [FirstName] From [Employees]" connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" runat="server"/> </form> </body> </html>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からImageField.DataImageUrlField プロパティを検索する場合は、下記のリンクをクリックしてください。

- ImageField.DataImageUrlField プロパティのページへのリンク