MenuItem.PopOutImageUrl Property

Gets or sets the URL to an image that is displayed in a menu item to indicate that the menu item has a dynamic submenu.

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

public string PopOutImageUrl { get; set; }

Property Value

Type: System.String
The URL to an image that is displayed in a menu item to indicate that the menu item has a dynamic submenu. The default is an empty string (""), which indicates that this property is not set.

If System.Web.UI.WebControls.MenuRenderingMode is set to List, or if System.Web.UI.WebControls.MenuRenderingMode is set to Default and PagesSection.ControlRenderingCompatibilityVersion is set to 4.0 or later, this property has no effect. Use the Menu.DynamicEnableDefaultPopOutImage property or the Menu.StaticEnableDefaultPopOutImage property instead of this property.

If System.Web.UI.WebControls.MenuRenderingMode is set to Table, or if System.Web.UI.WebControls.MenuRenderingMode is set to Default and PagesSection.ControlRenderingCompatibilityVersion is set to 3.5, use this property to specify a custom image that is displayed in a menu item to indicate that the menu item has a dynamic submenu. This image can be in any file format (.jpg, .gif, .bmp, and so on), as long as the client's browser supports that format.

NoteNote

Setting this property overrides the image specified by the Menu.DynamicPopOutImageUrl and Menu.StaticPopOutImageUrl properties.

You can also disable this image in a static menu by setting this property to an empty string and setting the StaticEnableDefaultPopOutImage property to false. Similarly, you can disable this image in a dynamic menu by setting this property to an empty string and setting the DynamicEnableDefaultPopOutImage property to false.

The following example demonstrates how to use the PopOutImageUrl property to specify a custom image to display in a menu item when the menu item has a dynamic submenu.


<%@ 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>MenuItem Declarative Example</title>
</head>
<body>
    <form id="form1" runat="server">

      <h3>MenuItem Declarative Example</h3>

      <!-- Use declarative syntax to create the   -->
      <!-- menu structure. Create submenu items   -->
      <!-- by nesting them within parent menu     -->
      <!-- items.                                 -->
      <asp:menu id="NavigationMenu"
        staticdisplaylevels="1"
        staticsubmenuindent="10" 
        orientation="Vertical" 
        target="_blank"  
        runat="server">

        <items>
          <asp:menuitem navigateurl="Home.aspx" 
            text="Home"
            imageurl="Images\Home.gif"
            popoutimageurl="Images\Popout.jpg"   
            tooltip="Home">
            <asp:menuitem navigateurl="Music.aspx"
              text="Music"
              popoutimageurl="Images\Popout.jpg"
              tooltip="Music">
              <asp:menuitem navigateurl="Classical.aspx" 
                text="Classical"
                separatorimageurl="Images\Separator.jpg"
                tooltip="Classical"/>
              <asp:menuitem navigateurl="Rock.aspx"
                text="Rock"
                separatorimageurl="Images\Separator.jpg"
                tooltip="Rock"/>
              <asp:menuitem navigateurl="Jazz.aspx"
                text="Jazz"
                separatorimageurl="Images\Separator.jpg"
                tooltip="Jazz"/>
            </asp:menuitem>
            <asp:menuitem navigateurl="Movies.aspx"
              text="Movies"
              popoutimageurl="Images\Popout.jpg"              
              tooltip="Movies">
              <asp:menuitem navigateurl="Action.aspx"
                text="Action"
                separatorimageurl="Images\Separator.jpg"
                tooltip="Action"/>
              <asp:menuitem navigateurl="Drama.aspx"
                text="Drama"
                separatorimageurl="Images\Separator.jpg"
                tooltip="Drama"/>
              <asp:menuitem navigateurl="Musical.aspx"
                text="Musical"
                separatorimageurl="Images\Separator.jpg"
                tooltip="Musical"/>
            </asp:menuitem>
          </asp:menuitem>
        </items>

      </asp:menu>

    </form>
  </body>
</html>

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft