GridView.BackImageUrl Property
.NET Framework (current version)
Gets or sets the URL to an image to display in the background of a GridView control.
Assembly: System.Web (in System.Web.dll)
The following example demonstrates how to use the BackImageUrl property to display a custom image in the background of a GridView control.
<%@ Page language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>GridView BackImageUrl Example</title> </head> <body> <form id="form1" runat="server"> <h3>GridView BackImageUrl Example</h3> <asp:gridview id="CustomersGridView" datasourceid="CustomersSource" autogeneratecolumns="true" emptydatatext="No data available." backimageurl="~/images/logo.jpg" runat="server"> </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="CustomersSource" selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]" connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" runat="server"/> </form> </body> </html>
.NET Framework
Available since 2.0
Available since 2.0
Show:
