Hi, i have the following structure of my website
folder1 t1.aspx t2.aspxfolder2 t3.aspxmasterpage (with the webdatamenu)when i now click in the menu t1.aspx ( navigateurl is folder1/t1.aspx)it workswhen i now click t3.asp (navigateurl is folder2/t3.aspx) it does'nt work because the folder isfolder1/folder2/t3.aspx
with ~/ i cannot work , because it does'nt work :(how must i set the pathes to the pages ?
Good morning,
I have workarounded the issue by adding the "~" in the code behind:
foreach (DataMenuItem it0 in wdmS2go.Items) { if (string.IsNullOrEmpty(it0.NavigateUrl)) { foreach (DataMenuItem it1 in it0.Items) if (string.IsNullOrEmpty(it1.NavigateUrl)) { foreach (DataMenuItem it2 in it1.Items) if (string.IsNullOrEmpty(it2.NavigateUrl)) {
} else it2.NavigateUrl = "~" + it2.NavigateUrl; } else it1.NavigateUrl = "~" + it1.NavigateUrl; } else it0.NavigateUrl = "~" + it0.NavigateUrl; }
Hello Martin,
You can just define ItemTemplate once for the menu (it is property of the WebDataMenu), and it will be applied to all items. You can use the sample I provided to avoid multiple template definitions for every item. And to keep styling you can just add the following class name for the HyperLink inside the template:
CssClass="igdm_RedPlanetMenuItemHorizontalRootLink"
Best regards,
Hi Anton, :) it seems to be work. i do the following
<
Items>
="Test1">
>
="test2">
On thing , in the template i have at them moment not the style (for the childs) that are under
StyleSetName
="RedPlanet"
defined
Sure, using ItemTemplate solves your issue with ~/ path. Once you put the ASP:HYPERLINK control inside template, like the example I provided, and do not change anything in the menu items definitions, your links will begin behave as expected.
Kind regards,Anton
Hi Anton, thanks for your reply. Did the Templates solves my ~/ path problem ? i am think no , or ?
greetings