Without a menu the asp.net web application is hard to navigate. We can even
bind to a hierarchical data. Or with little additional work the database tables
can be bound easily.
Format Base Menu
Base menu can be formatted using some simple format options(similar like
anyother controls in asp.net shown as below). But the important item to be noted
is the section where this is applied for. To format base menu use
LevelMenuItemStyles section(BackColor="Silver" BorderStyle="Dashed"
BorderWidth="1"). If the menu has to be displayed horizontally, the orientation
attribute has to be changed accordingly(Orientation="Horizontal") which is
availabel in the
Sample grey background style will look like
Font-Bold="true" BorderColor="Gray" BorderWidth="1" HorizontalPadding="10px" />
Format Menu Item
Same as base menu but here the style is in the same tag. The tag is
DynamicMenuItemStyle. sample of the dynamic menu item style
is.
Font-Bold="true" BorderStyle="Solid" BorderColor="Gray" BorderWidth="1"
HorizontalPadding="10px" />
Selected Menu using DynamicSelectedStyle
The following sample will highlight both base menu and the sub menus. The
base menu is handled by LevelSelectedStyles and the sub menu is hadled by
DynamicSelectedStyle. Currently i have used BackColor for understanding
purposes.
BackColor="Gray" ForeColor="White" Font-Bold="true" BorderStyle="Solid"
BorderColor="Gray" BorderWidth="1" HorizontalPadding="10px" />
BackColor="Maroon" ForeColor="Orange" Font-Bold="true"
BorderStyle="Solid"
BorderColor="Gray"
BorderWidth="1" HorizontalPadding="10px" />
For references
Formatting items in ASP.Net Menu
bind to a hierarchical data. Or with little additional work the database tables
can be bound easily.
Format Base Menu
Base menu can be formatted using some simple format options(similar like
anyother controls in asp.net shown as below). But the important item to be noted
is the section where this is applied for. To format base menu use
LevelMenuItemStyles section(BackColor="Silver" BorderStyle="Dashed"
BorderWidth="1"). If the menu has to be displayed horizontally, the orientation
attribute has to be changed accordingly(Orientation="Horizontal") which is
availabel in the
Sample grey background style will look like
Format Menu Item
Same as base menu but here the style is in the same tag. The tag is
DynamicMenuItemStyle. sample of the dynamic menu item style
is.
HorizontalPadding="10px" />
Selected Menu using DynamicSelectedStyle
The following sample will highlight both base menu and the sub menus. The
base menu is handled by LevelSelectedStyles and the sub menu is hadled by
DynamicSelectedStyle. Currently i have used BackColor for understanding
purposes.
BorderColor="Gray" BorderWidth="1" HorizontalPadding="10px" />
BorderStyle="Solid"
BorderColor="Gray"
BorderWidth="1" HorizontalPadding="10px" />
For references
Formatting items in ASP.Net Menu
0 comments:
Post a Comment