BackImageUrl Property
Collapse the table of content
Expand the table of content

GridView.BackImageUrl Property


Gets or sets the URL to an image to display in the background of a GridView control.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public virtual string BackImageUrl { get; set; }

Property Value

Type: System.String

The URL of an image to display in the background of the GridView control. The default is an empty string (""), which indicates that this property is not set.

Use the BackImageUrl property to specify the URL to an image to display in the background of a GridView control.


If the specified image is smaller than the GridView control, the image is tiled to fill in the background. If the image is larger than the control, the image is cropped.

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"
<html xmlns="" >
  <head runat="server">
    <title>GridView BackImageUrl Example</title>
    <form id="form1" runat="server">

      <h3>GridView BackImageUrl Example</h3>

      <asp:gridview id="CustomersGridView" 
        emptydatatext="No data available." 


      <!-- 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%>" 


.NET Framework
Available since 2.0
Return to top
© 2015 Microsoft