BackImageUrl Property

FormView.BackImageUrl Property


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

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

Public Overridable Property BackImageUrl As String

Property Value

Type: System.String

The URL to an image to display in the background of the FormView 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 FormView control.


If the specified image is smaller than the FormView 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 FormView control.

<%@ Page language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="" >
  <head runat="server">
    <title>FormView BackImageUrl Example</title>
    <form id="form1" runat="server">

      <h3>FormView BackImageUrl Example</h3>

      <asp:formview id="EmployeeFormView"


                <asp:image id="EmployeeImage"
                  imageurl='<%# Eval("PhotoPath") %>'
                  alternatetext='<%# Eval("LastName") %>' 
                <h3><%# Eval("FirstName") %>&nbsp;<%# Eval("LastName") %></h3>      
                <%# Eval("Title") %>        


        <pagersettings position="Bottom"


      <!-- 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="EmployeeSource"
        selectcommand="Select [EmployeeID], [LastName], [FirstName], [Title], [PhotoPath] From [Employees]"
        connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" 


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