|
Rank: Member Groups: Member
Joined: 10/18/2010 Posts: 29
|
Hello
I currently have my EO:Menu connected to an XML file to provide the menu structure to be shown. Within the menu builder, I can see how you can set the target window for a particular menu option, but my options reside in the xml file. Is there a way that I can set individual menu options that are stored in the XML file to open into new pages via the EO Menu
Thanks
Jason
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, You can use a DataBinding object to map an xml attribute to a menu item property. See this page for more details: http://www.essentialobjects.com/doc/1/menucommon/databinding/populate_datasource.aspxThanks!
|
|
Rank: Member Groups: Member
Joined: 10/18/2010 Posts: 29
|
Hello
Thanks for your quick reply! I sort of understand what you mean, but I'm struggling to understand where I would place this sort of code in relation to the bindings?:
<eo:Menu Runat="server" DataSourceID="XmlDataSource1"> <TopGroup> <Bindings> <eo:DataBinding Property="Value" DataField="@title"> </eo:DataBinding> </Bindings> </TopGroup> </eo:Menu>
I have my EO menu sitting in a master page, and the xsd file links into the menu via the xmlfile property. Where exactly where would I perform the data binding? Would the databinding property be "target", and how would I then associate that with specific menu item? For example, this is an example of the menu structure in the xml:
<category title="Phone Communication"> <category url="~/PhoneCallAdd.aspx" title="Create"/> <category url="~/PhoneCallEdit.aspx" title="Append"/> <category url="~/PhoneCallSearch1.aspx" title="Search Phone Communications by Keyword"/> <category url="~/PhoneCallSearch2.aspx" title="Search Phone Communications by Organisation"/> </category>
In this menu, I only need the first page ( <category url="~/PhoneCallAdd.aspx" title="Create"/>) to open into a new page, all the others are fine to open into the content page holder in the master page. How can I use databinding to associate the target = _blank with specific menu options?
Many thanks
Jason
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
If you just want to set the target window as "_blank", then you can handle the Menu's ItemCreated event and set e.MenuItem.TargetWindow to "_blank". If you want that property to be set based on data in your xml file, then you use DataBinding object with Property set to "TargetWindow" and DataField set to your xml attribute.
Thanks
|
|
Rank: Member Groups: Member
Joined: 10/18/2010 Posts: 29
|
Hello
Looks like I've got it working, many thanks
Jason
|
|