System.Web.UI.WebControls.MenuItemBinding.ImageUrl Property

Gets or sets the URL to an image that is displayed next to the text of a menu item to which the System.Web.UI.WebControls.MenuItemBinding object is applied.

Syntax

[System.ComponentModel.Editor("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))]
[System.Web.UI.UrlProperty]
[System.ComponentModel.DefaultValue("")]
public string ImageUrl { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

When the System.Web.UI.WebControls.Menu control is bound to a data source, use the MenuItemBinding.ImageUrl property to specify the URL of a custom image to bind to the MenuItem.ImageUrl property of a System.Web.UI.WebControls.MenuItem object. This image is shared with all System.Web.UI.WebControls.MenuItem objects to which the System.Web.UI.WebControls.MenuItemBinding object is applied. The image is displayed next to a menu item's text and can be in any file format (.jpg, .gif, .bmp, and so on), as long as the client's browser supports that format.

Note:

You can override the image for an individual menu item by setting its MenuItem.ImageUrl property directly.

Instead of using this property to display the same image in each menu item, you can also use the MenuItemBinding.ImageUrlField property to bind the MenuItem.ImageUrl property of a System.Web.UI.WebControls.MenuItem object to a field of a data source. When rendered, the MenuItem.ImageUrl property of each menu item to which the System.Web.UI.WebControls.MenuItemBinding object is applied contains the corresponding value from the field.

Note:

If the MenuItemBinding.ImageUrl and MenuItemBinding.ImageUrlField properties are both set, the MenuItemBinding.ImageUrlField property takes precedence.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0