Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
BackImageUrl Property

Panel.BackImageUrl Property

Gets or sets the URL of the background image for the panel control.

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

public virtual string BackImageUrl { get; set; }
/** @property */
public String get_BackImageUrl ()

/** @property */
public void set_BackImageUrl (String value)

public function get BackImageUrl () : String

public function set BackImageUrl (value : String)

Property Value

The URL of the background image for the panel control. The default is String.Empty.

Use this property to display a custom image for the Panel control.

If the image is smaller than the Panel, it will be tiled to fill in the Panel.


This property is supported only on browsers that support HTML 4.0 or later.

The following example illustrates how to programmatically set the BackImageUrl property of the Panel.


The following code sample uses the single-file code model and may not work correctly if copied directly into a code-behind file. This code sample must be copied into an empty text file that has an .aspx extension. For more information on the Web Forms code model, see ASP.NET Web Page Code Model.

<%@ Page Language="C#" AutoEventWireup="True" %>
     <script language="C#" runat="server">
     void Page_Load(Object sender, EventArgs e) {
        Label l = new Label();
        l.Text = "This panel contains a right justified label.";
     void Button1_Click(Object sender, EventArgs e) {
        Panel1.BackImageUrl = 
     <h3>Panel Example</h3>
     <form runat=server>
     <asp:Panel id="Panel1" Height=200 Width=200 BackColor="Gainsboro"
     Wrap="True" HorizontalAlign="Right" runat="server"/>
         <asp:Button id="Button1" OnClick="Button1_Click"
     Text="Set the label background" runat="server"/>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

© 2015 Microsoft