GridView.BackImageUrl 속성

정의

GridView 컨트롤의 배경에 표시할 이미지의 URL을 가져오거나 설정합니다.

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

속성 값

String

GridView 컨트롤의 배경에 표시할 이미지의 URL입니다. 기본값은 빈 문자열("")로, 이 속성이 설정되어 있지 않음을 나타냅니다.

예제

다음 예제에서는 컨트롤의 GridView 배경에 BackImageUrl 사용자 지정 이미지를 표시 하는 속성을 사용 하는 방법을 보여 줍니다.


<%@ 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>

설명

컨트롤의 BackImageUrl 배경에 표시할 이미지의 GridView URL을 지정하려면 이 속성을 사용합니다.

참고

지정된 이미지가 컨트롤보다 GridView 작으면 이미지가 바일링되어 배경에 채워집니다. 이미지가 컨트롤보다 크면 이미지가 잘립니다.

적용 대상

추가 정보