Wednesday 21 August 2013

Menu in asp.net

                              Menu in asp.net  

The Menu control is used to create a menu of hierarchical data that can be used to navigate through the pages. The Menu control conceptually contains two types of items. First is StaticMenu that is always displayed on the page, Second is DynamicMenu that appears when opens the parent item.
Its properties like BackColor, ForeColor, BorderColor, BorderStyle, BorderWidth, Height etc. are implemented through style properites of <table, tr, td/> tag.
Following are some important properties that are very useful.
Properties of Menu Control
DataSourceIDIndicates the data source to be used (You can use .sitemap file as datasource).
TextIndicates the text to display in the menu.
TooltipIndicates the tooltip of the menu item when you mouse over.
ValueIndicates the nondisplayed value (usually unique id to use in server side events)
NavigateUrlIndicates the target location to send the user when menu item is clicked. If not set you can handle MenuItemClick event to decide what to do.
TargetIf NavigationUrl property is set, it indicates where to open the target location (in new window or same window).
Selectabletrue/false. If false, this item can't be selected. Usually in case of this item has some child.
ImageUrlIndicates the image that appears next to the menu item.
ImageToolTipIndicates the tooltip text to display for image next to the item.
PopOutImageUrlInidcates the image that is displayed right to the menu item when it has some subitems.
TargetIf NavigationUrl property is set, it indicates where to open the target location (in new window or same window).
Styles of Menu Control
StaticMenuStyleSets the style of the parent box in which all menu items appears.
DynamicMenuStyleSets the style of the parent box in which dynamic menu items appears.
StaticMenuItemStyleSets the style of the individual static menu items.
DynamicMenuItemStyleSets the style of the individual dynamic menu items.
StaticSelectedStyleSets the style of the selected static items.
DynamicSelectedStyleSets the style of the selecdted dynamic items.
StaticHoverStyleSets the mouse hovering style of the static items.
DynamicHoverStyleSets the mouse hovering style of the dynamic items (subitems).

No comments:

Post a Comment