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

Dim instance As CommandField Dim value As String value = instance.UpdateImageUrl instance.UpdateImageUrl = value
/** @property */ public String get_UpdateImageUrl () /** @property */ public void set_UpdateImageUrl (String value)
CommandField の Update ボタンに表示するイメージの URL。既定値は空の文字列 ("") です。このプロパティが設定されていないことを示します。

CommandField フィールドの ButtonType プロパティが ButtonType.Image に設定されている場合は、UpdateImageUrl プロパティを使用して、Update ボタンに表示するイメージを指定します。クライアントのブラウザでサポートされてさえいれば、このイメージにはどのようなファイル形式 (.jpg、.gif、.bmp など) でも使用できます。
![]() |
---|
Update ボタンにイメージを表示する代わりに、ButtonType プロパティを ButtonType.Button または ButtonType.Link に設定し、次に UpdateText プロパティを設定して、テキストを表示することもできます。 |

UpdateImageUrl プロパティを使用して、GridView コントロールの CommandField フィールドの Update ボタンに表示するカスタム イメージを指定する方法を次のコード例に示します。Update ボタンにイメージを表示するには、ButtonType プロパティを ButtonType.Image に設定する必要があります。
<%@ Page language="VB" %> <html> <body> <form runat="server"> <h3>CommandField Example</h3> <asp:gridview id="CustomersGridView" datasourceid="CustomersSqlDataSource" autogeneratecolumns="false" datakeynames="CustomerID" runat="server"> <columns> <asp:commandfield showeditbutton="true" buttontype="Image" editimageurl="~\Images\EditButton.jpg" cancelimageurl="~\Images\CancelButton.jpg" updateimageurl="~\Images\UpdateButton.jpg" headertext="Edit Controls"/> <asp:boundfield datafield="CustomerID" headertext="Customer ID" /> <asp:boundfield datafield="CompanyName" headertext="Company Name"/> <asp:boundfield datafield="Address" headertext="Address"/> <asp:boundfield datafield="City" headertext="City"/> <asp:boundfield datafield="PostalCode" headertext="ZIP Code"/> <asp:boundfield datafield="Country" headertext="Country"/> </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="CustomersSqlDataSource" selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]" updatecommand="Update Customers Set CompanyName=@CompanyName, Address=@Address, City=@City, PostalCode=@PostalCode, Country=@Country Where (CustomerID = @CustomerID)" connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" runat="server"> </asp:sqldatasource> </form> </body> </html>
<%@ Page language="C#" %> <html> <body> <form runat="server"> <h3>CommandField Example</h3> <asp:gridview id="CustomersGridView" datasourceid="CustomersSqlDataSource" autogeneratecolumns="false" datakeynames="CustomerID" runat="server"> <columns> <asp:commandfield showeditbutton="true" buttontype="Image" editimageurl="~\Images\EditButton.jpg" cancelimageurl="~\Images\CancelButton.jpg" updateimageurl="~\Images\UpdateButton.jpg" headertext="Edit Controls"/> <asp:boundfield datafield="CustomerID" headertext="Customer ID" /> <asp:boundfield datafield="CompanyName" headertext="Company Name"/> <asp:boundfield datafield="Address" headertext="Address"/> <asp:boundfield datafield="City" headertext="City"/> <asp:boundfield datafield="PostalCode" headertext="ZIP Code"/> <asp:boundfield datafield="Country" headertext="Country"/> </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="CustomersSqlDataSource" selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]" updatecommand="Update Customers Set CompanyName=@CompanyName, Address=@Address, City=@City, PostalCode=@PostalCode, Country=@Country Where (CustomerID = @CustomerID)" connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" runat="server"> </asp:sqldatasource> </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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CommandField クラス
CommandField メンバ
System.Web.UI.WebControls 名前空間
ButtonFieldBase.ButtonType プロパティ
CommandField.CancelImageUrl プロパティ
CommandField.CancelText プロパティ
CommandField.DeleteImageUrl プロパティ
CommandField.DeleteText プロパティ
CommandField.EditImageUrl プロパティ
CommandField.EditText プロパティ
CommandField.InsertImageUrl プロパティ
CommandField.InsertText プロパティ
CommandField.NewImageUrl プロパティ
CommandField.NewText プロパティ
CommandField.SelectImageUrl プロパティ
CommandField.SelectText プロパティ
CommandField.ShowCancelButton プロパティ
CommandField.ShowEditButton プロパティ
UpdateText
Weblioに収録されているすべての辞書からCommandField.UpdateImageUrl プロパティを検索する場合は、下記のリンクをクリックしてください。

- CommandField.UpdateImageUrl プロパティのページへのリンク