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

PanelStyle.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 Value

Type: System.String
The URL of the background image for the panel control. The default value is an empty string ("").


The BackImageUrl property is null.

The BackImageUrl property specifies the URL of the background image for the panel control. For this property to work, an image file must exist at the specified location. If the specified image file is not accessible, then the panel control is displayed without a background image.

The following code example applies the same background image to two panel controls, Panel1 and Panel2. For this example to work correctly, you must provide your own image. This code example is part of a larger example provided for the PanelStyle class.

public partial class PanelStylecs_aspx : Page
    void Page_Load(object sender, EventArgs e)
        StateBag panelState = new StateBag();
        PanelStyle myPanelStyle = new PanelStyle(panelState);

        // Set the properties of the PanelStyle class.
        myPanelStyle.HorizontalAlign = HorizontalAlign.Center;
        myPanelStyle.ScrollBars = ScrollBars.Both;
        myPanelStyle.Wrap = false;
        myPanelStyle.Direction = ContentDirection.LeftToRight;
        myPanelStyle.BackImageUrl = @"~\images\picture.jpg";

        // Use the ApplyStyle method of the Panel control to apply
        // the settings from the myPanelStyle object.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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

Community Additions

© 2015 Microsoft