DetailsView.BackImageUrl 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
컨트롤의 배경에 표시할 이미지의 URL을 DetailsView 가져오거나 설정합니다.
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
속성 값
컨트롤의 배경에 표시할 이미지의 URL입니다 DetailsView . 기본값은 이 속성이 설정되지 않음을 나타내는 빈 문자열("")입니다.
예제
다음 코드 예제에서는 컨트롤의 배경에 BackImageUrl 사용자 지정 이미지를 표시 하는 속성을 사용 하는 방법을 보여 줍니다 DetailsView . 이 예제가 작동하려면 사용자 고유의 이미지를 제공해야 합니다.
<%@ 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>DetailsView BackImageUrl Example</title>
</head>
<body>
<form id="Form1" runat="server">
<h3>DetailsView BackImageUrl Example</h3>
<asp:detailsview id="CustomerDetailView"
datasourceid="DetailsViewSource"
datakeynames="CustomerID"
autogeneraterows="true"
allowpaging="true"
backimageurl="~\images\BackgroundImage.jpg"
runat="server">
<headerstyle backcolor="Navy"
forecolor="White"/>
</asp:detailsview>
<!-- 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="DetailsViewSource" runat="server"
ConnectionString=
"<%$ ConnectionStrings:NorthWindConnectionString%>"
InsertCommand="INSERT INTO [Customers]([CustomerID],
[CompanyName], [Address], [City], [PostalCode], [Country])
VALUES (@CustomerID, @CompanyName, @Address, @City,
@PostalCode, @Country)"
SelectCommand="Select [CustomerID], [CompanyName],
[Address], [City], [PostalCode], [Country]
From [Customers]">
</asp:SqlDataSource>
</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>DetailsView BackImageUrl Example</title>
</head>
<body>
<form id="Form1" runat="server">
<h3>DetailsView BackImageUrl Example</h3>
<asp:detailsview id="CustomerDetailView"
datasourceid="DetailsViewSource"
datakeynames="CustomerID"
autogeneraterows="true"
allowpaging="true"
backimageurl="~\images\BackgroundImage.jpg"
runat="server">
<headerstyle backcolor="Navy"
forecolor="White"/>
</asp:detailsview>
<!-- 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="DetailsViewSource" runat="server"
ConnectionString=
"<%$ ConnectionStrings:NorthWindConnectionString%>"
InsertCommand="INSERT INTO [Customers]([CustomerID],
[CompanyName], [Address], [City], [PostalCode], [Country])
VALUES (@CustomerID, @CompanyName, @Address, @City,
@PostalCode, @Country)"
SelectCommand="Select [CustomerID], [CompanyName],
[Address], [City], [PostalCode], [Country]
From [Customers]">
</asp:SqlDataSource>
</form>
</body>
</html>
설명
컨트롤의 BackImageUrl 배경 DetailsView 에 표시할 이미지의 URL을 지정하려면 이 속성을 사용합니다.
메모
지정한 이미지가 컨트롤보다 DetailsView 작으면 이미지가 바일링되어 배경을 채웁니다. 이미지가 컨트롤보다 크면 이미지가 잘립니다.