ASP.NET Text Menu - One simple method - Add

Name Description
methodAdd Add ( parent_id,  id,  innerHtml,  url,  url_Target )
parent_id id of the Parent Item. Optional.
Set null for first level.

id id of the menu item.

innerHtml Text or HTML code inside the menu item. Optional

url Url to navigate. Also can contain javascript. Optional.

url_Target Frame where the url is to be opened. Optional.


 
Brands>
Systems>
Hardware>
Software>


Example - using code
// First level
tm1.Add(null, "id_brands", "Brands", "javascript:alert('you clicked me');void(0);", null);
tm1.Add(null, "id_systems", "Systems", null, null);

// Sub menu
tm1.Add("id_brands", "id_ibm", "IBM", null, null);
tm1.Add("id_brands", "id_obout", "OBOUT", "http://www.obout.com/", null);
        
// Sub menu
tm1.Add("id_obout", "id_tree", "Treeview", "treeview.aspx", null);
tm1.Add("id_obout", "id_calendar", "Calendar", "calendar.aspx", null);
Example - declarative
<tm:TextMenu runat="server" id="TextMenu1">

// First level
<tm:Item ID="brands" InnerHtml="Brands" Url="javascript:alert('you clicked me');void(0);">

</tm:Item>
<tm:Item ID="systems" InnerHtml="Systems"></tm:Item>

// Sub menu
<tm:Item ParentID="brands" ID="ibm" InnerHtml="IBM"></tm:Item>
<tm:Item ParentID="brands" ID="obout" InnerHtml="OBOUT" Url="http://www.obout.com/">

</tm:Item>

// Sub menu
<tm:Item ParentID="obout" ID="treeview" InnerHtml="TreeView" Url="treeview.aspx"></tm:Item>
<tm:Item ParentID="obout" ID="calendar" InnerHtml="Calendar" Url="calendar.asp"></tm:Item>
...
</tm:TextMenu>