GridView.BackImageUrl Özellik

Tanım

Bir denetimin arka planında görüntülenecek görüntünün URL 'sini alır veya ayarlar GridView .Gets or sets the URL to an image to display in the background of a GridView control.

public:
 virtual property System::String ^ BackImageUrl { System::String ^ get(); void set(System::String ^ value); };
public virtual string BackImageUrl { get; set; }
member this.BackImageUrl : string with get, set
Public Overridable Property BackImageUrl As String

Özellik Değeri

String

Denetimin arka planında görüntülenecek görüntünün URL 'SI GridView .The URL of an image to display in the background of the GridView control. Varsayılan değer, bu özelliğin belirlenmediğini belirten boş bir dizedir ("").The default is an empty string (""), which indicates that this property is not set.

Örnekler

Aşağıdaki örnek, BackImageUrl bir denetimin arka planında özel bir görüntü göstermek için özelliğinin nasıl kullanılacağını gösterir GridView .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>


<%@ Page language="VB" %>

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

Açıklamalar

BackImageUrlBir denetimin arka planında görüntülenecek görüntünün URL 'sini belirtmek için özelliğini kullanın GridView .Use the BackImageUrl property to specify the URL to an image to display in the background of a GridView control.

Not

Belirtilen görüntü denetimden daha küçükse GridView , görüntü arka planı dolduracak şekilde döşenir.If the specified image is smaller than the GridView control, the image is tiled to fill in the background. Görüntü denetimden büyükse, görüntü kırpılır.If the image is larger than the control, the image is cropped.

Şunlara uygulanır

Ayrıca bkz.