|
 | What's New |
 | Overview |
 | Features |
 | Reference Book |
 | Licensing |
 | Support |
|  | Contacts |
|  | FAQs |
|  | Feature Request |
 | Populating with Data |
 | Appearance |
 | Layout |
 | Behavior |
 | Programming |
|  | Client side event |
|  | Server side event |
|
|
|
|
APNSoft Menu uses XML for defining Menu Structure since XML is the most convenient format for structured data. The XML Menu Structure consists of a number of elements (items).
<menu>
<item title="Main Page" />
<item title="About Us" />
<item title="Products">
<item title="APNSoft Menu" />
<item title="APNSoft Include" />
</item>
<separator />
<item title="Contacts" />
</menu>
The code above creates the following menu (horizontal orientation):
You can save the XML definition structure as a file (Menu Structure File) and bind the menu by specifying the StructureFileURL property of the Menu component.
You can build up menu at runtime. APNSoft Menu provides an extremely rich and powerful server-side API allowing developer to add, remove or edit menu elements and element collections. You can programmatically control any menu item at runtime by using two classes MenuElement and MenuElementCollection.
You can also apply the XML Document with structure by using the DataSource property. If the menu loads structure from the database, you should set the DataSource property to specify a source of data and call the DataBind() method.
APNSoft Menu has support to use the Web.sitemap file as a standard menu structure.
Structure elements
- menu - the root element for entire Menu Structure. Attributes are not included.
- item - one menu item element. Each item element can include other item elements.
Item node can include attributes:
Attributes for Precise Customization:
- css_Item_MainTdd - user-defined CSS class for one item customization (Main menu, horizontal orientation).
- css_Item_MainTrd, css_Item_MainTd - user-defined CSS classes for one item customization (Main menu, vertical orientation).
- css_Item_SubTrd, css_Item_SubTd - user-defined CSS classes for one item customization (Submenus).
- css_submenu_ParentSubTab, css_submenu_ParentSubTd, css_submenu_SubTab - user-defined CSS classes for submenu customization. Attributes are used for the item that is the parent item for the submenu to be customized.
- separator - element for horizontal or vertical separator. Can include attributes:
- id - is used in order to ensure uniqueness.
If the id attribute is not specified, the component will automatically set it for each menu separator (id="spr1", id="spr2", etc.)
- image - specifies the name of the picture, used for separator.
- imageWidth, imageHeight - one separator's image width and height.
Attribute for Precise Customization:
- css_separator_Spr - user-defined CSS class for one separator customization.
Examples for menu items
<item id="1" title="Home"/>
<item title="Home" href="?MD=Home"/>
<item title="Google" href="http://www.google.com" target="_blank"/>
<item title="JavaScript" href="javascript:ItemClick('$MenuID$','$ItemID$');" />
<item title="Home" icon="Home.gif" iconWidth="16" iconHeight="16"/>
<item title="Awards" icon="Awards.gif" iconOver="AwardsOver.gif"/>
<item image="HOMEd.jpg" imageOver="HOMEe.jpg"/>
<separator image= "SEPARATORv.jpg" imageWidth="2" imageHeight="32"/>
Attention! Element names and attributes are case-sensitive. Be careful when you're typing in your data.
|
|
|