Redigera

Dela via


WebZone.BackImageUrl Property

Definition

Gets or sets the URL to a background image for a zone.

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

Property Value

A string that represents the URL to an image used as a background image for the zone. The default value is an empty string ("").

Examples

The following code example demonstrates the use of the BackImageUrl property. Note that there are two zones in the declarative markup, and the second <asp:webpartzone> element is empty.

<%@ page language="C#" %>
<%@ register TagPrefix="uc1" 
  TagName="DisplayModeMenuCS" 
  Src="DisplayModeMenuCS.ascx" %>
<!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 id="Head1" runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
  <form id="Form1" runat="server">
    <asp:webpartmanager id="WebPartManager1" runat="server" />
    <uc1:DisplayModeMenuCS ID="DisplayModeMenu1" runat="server" />
    <asp:webpartzone
      id="WebPartZone1"
      runat="server">
        <zonetemplate>
          <asp:Calendar ID="cal1" Runat="server" Title="My Calendar" />
        </zonetemplate>
    </asp:webpartzone>
    <asp:webpartzone
      id="WebPartZone2"
      runat="server" 
      BackImageUrl="image.GIF">
    </asp:webpartzone>
  </form>
</body>
</html>
<%@ page language="VB" %>
<%@ register TagPrefix="uc1" 
  TagName="DisplayModeMenuVB" 
  Src="DisplayModeMenuVB.ascx" %>
<!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 id="Head1" runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
  <form id="Form1" runat="server">
    <asp:webpartmanager id="WebPartManager1" runat="server" />
    <uc1:DisplayModeMenuVB ID="DisplayModeMenu1" runat="server" />
    <asp:webpartzone
      id="WebPartZone1"
      runat="server">
        <zonetemplate>
          <asp:Calendar ID="cal1" Runat="server" Title="My Calendar" />
        </zonetemplate>
    </asp:webpartzone>
    <asp:webpartzone
      id="WebPartZone2"
      runat="server" 
      BackImageUrl="image.GIF">
    </asp:webpartzone>
  </form>
</body>
</html>

In a browser, you can switch to design mode to see the image in the empty zone. Note that an actual URL for the BackImageUrl property is not provided in this example. For details on how to change page display modes, see Walkthrough: Changing Display Modes on a Web Parts Page.

Remarks

The background image for a zone is visible in all display modes in which a zone's contents are visible. If a zone contains part controls, the image appears behind the controls. If a zone contains no controls, its contents are not rendered in browse mode, so the image is not displayed.

If the supplied image is smaller than the body of a zone, it is tiled to cover the full body area.

Applies to

See also