I am looking for sample format/structure of XML/XSL for UltraWebMenu, any help will be appreciated.
Have a look at this example below. I did not find the documentation very helpful and got to this by trial and error. There are a few tricks to get this working.
1. To get rid of the "root" men (and possible an "Item" Menu) you must add "/root/Item" as the Xpath expression when you Configure Data Source
2. Do not enclose your sub Items within <Items></Items> tags as you will just get a submenu called Items. Likewise do not create <Images> tags as they are not necessary. The markup when you preset a menu has these tags and so, in the absence of any samples (Infragistics please note) you may be fooled into thinking these are required.
3. Bind the Item tag once and set the Depth to -1. The documentation example (and I only found anything useful in the NET 8.3 docs) has 2 levels of Menu and sets the Depth to 2. This is confusing as the result is that the you get 2 levels of menu with the text "Item" in them. The example has a top menu with just the word "Item" - I think duh! is appropriate here. Why -1 I don't know. And no you can't change /root/Item in the Xpath to /root and then set Depth to 0.
4. In the Item Binding set ImageUrlField to "ImageUrl", TargetUrlField to "TargetUrl" and TextField to "Text". I am not sure whether these could ever be set to anything else meaningful. Anyway these are what did it in my example below
The example works fine as a Horizontal menu. I have tested this in a simple example but not yet implemented it in the full application where I have made menu changes using code, as 4 months ago I could not figure the XML at all.
<root> <Item ImageUrl="./images/home.gif" TargetUrl="HomePage.aspx" Text="Home Page"> </Item> <Item ImageUrl="./images/icon-calendar.gif" Separator="True" Text=""> </Item> <Item ImageUrl="./images/BlockBook.gif" TargetUrl="DiaryDisplay.aspx" Text="Zone Manager Diary"> </Item> <Item ImageUrl="./images/FlatBed_ArriveOrig.gif" Text="Diary Entries"> <Item ImageUrl="./images/FlatBed_ArriveOrig.gif" TargetUrl="EnterBooking.aspx" Text="Enter a Booking"> </Item> <Item ImageUrl="./images/WebViewandEdit.gif" TargetUrl="Bookings.aspx" Text="View and Edit Bookings"> </Item> </Item> <Item ImageUrl="./images/bars.gif" Separator="True" Text=""> </Item> <Item Hidden="True" ImageUrl="./images/FlatBed_ArriveQuestion.gif" Text="Booking Requests"> <Item TargetUrl="BookRequest.aspx" Text="Enter a Booking Request"> </Item> <Item TargetUrl="OutstandingBookings.aspx" Text="View and Edit Booking Requests"> </Item> </Item> <Item ImageUrl="./images/GATEOPEN.gif" Text="Gate Operations"> <Item TargetUrl="GateOpsArrive.aspx" Text="Arrive Vehicles" ToolTip="Log vehicles on site"> </Item> <Item TargetUrl="GateOpsDepart.aspx" Text="Depart Vehicles" ToolTip="Log Vehicles off Site"> </Item> </Item> <Item ImageUrl="./images/help.gif" TargetUrl="Help.aspx" Text="Help"> </Item> <Item TargetUrl="ZM_Logout.aspx" Text="Log Off"> </Item></root>
Hello,Please taka e look at the code below: <div> <ignav:UltraWebMenu ID="UltraWebMenu1" XSLFile="~/sample.xml" runat="server" DataSourceID="XmlDataSource1" JavaScriptFilename="" JavaScriptFileNameCommon="" TargetFrame="" TargetUrl=""> <ExpandEffects ShadowColor="LightGray"></ExpandEffects> <MenuClientSideEvents InitializeMenu="" ItemChecked="" ItemClick="" ItemHover="" SubMenuDisplay="" /> </ignav:UltraWebMenu> <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/sample.xml"></asp:XmlDataSource> </div>Hope this helps.