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 ?
Hello Martin,
You can try using syntax like:"/folder1/t1.aspx", "/folder1/t2.aspx", "/folder2/t3.aspx". Which is prefixed with "/" (the server root) but without the "~" sign.
And also you can contact our developer support to request a feature for taking into acocunt the standard ASP.NET syntax of "~/": http://support.infragistics.com/Protected/RequestFeature.aspx
Hope this helps
thanks just tested but it does'nt work . because they go a level higher
>And also you can contact our developer support to request a feature for taking into acocunt the standard >ASP.NET syntax of "~/": http://support.infragistics.com/Protected/RequestFeature.aspx
Nice, but not aceptable for me. because i need very fast a new webmenu, because the current webmenu also doen'st worksee http://forums.infragistics.com/forums/t/2242.aspxgreetings Martin
A very fast solution could be to use absolute URLs for the links. For examples:
<ig:DataMenuItem navigateUrl=http://www.yoursite.com/site_root/folder1/t1.aspx />
Than it will work for sure. However you will not be able to test locally.
Also, if by ". because they go a level higher ", you mean that when you make the links with leading slash (/) they go the ROOT level of web server - it is true. And if you are using the development server, which default option in Visual Studio, it will run your project on a URL like this:
http://localhost:14503/WebSite1/
Now from here your links will be: http://localhost:14503/WebSite1/folder1/t1.aspx
And defining navigateURL = "/folder1/t1.aspx" will lead to http://localhost:14503/folder1/t1.aspx
If this is what bothers you, you have another option (with leaving the leading slash for navigateURLs): Deploy your development project on IIS, than will run directly on http://localhost/ and you will not be having any issues with leading slashes. And it will work as it would if it was deployed on a live server.
Hope this helps.
..Than it will work for sure. However you will not be able to test locally.that it not so good. because iam still in development progress (it is an intranet solution)
>Also, if by ". because they go a level higher ", you mean that when you make the links with leading slash (/) they go the ROOT level of web server - it is true
Yes that i mean
>Deploy your development project on IIS, than will run directly on http://localhost/ and you will not be >having any issues with leading slashes
not possible because of several webseites............why does it work in the old WEBMENU and not working in the WEBDATAMENU
Hi Anton, me again .Is it possible to insert in anyway a <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/folder1/t1.aspx">HyperLink</asp:HyperLink>
Control ? i just test it with a simple menu . first i have the same issue with the links , but then i replace the normal link with the asp:Hyperlink then it works, because here i can work with ~/
Hello again Martin,
You can use ItemTemplate property of WebDataMenu to define default template for menu items.It can be used in way similar to this:
<
ItemTemplate><asp:HyperLink ID="hlMenu" runat="server" NavigateUrl='<%# ((DataMenuItem)Container.Item).NavigateUrl %>' Text='<%# ((DataMenuItem)Container.Item).Text %>' /></ItemTemplate>
You can use any control within a template.
You can also review about DataMenu templates here: http://community.infragistics.com/aspnet/media/p/86762.aspx
Hi Anton, thanks for your reply. Did the Templates solves my ~/ path problem ? i am think no , or ?
greetings
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; }
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