Good Afternoon.
I realize there are a large number of threads on similar topics. However, none of the solutions I was able to find have worked.
I am given a list of structs from a function that accesses a database. The structs hold the absolute url path to a web site (potentially to an external site) and the desired text value of the link. I use the information in this list to construct a string that holds the xml needed to render the rad menu control. I do this so I can store the string as a session variable so I only need to access the database once. I then bind the menu to the string:
string linkMenuXML = Session["quicklinkXML"].ToString();
LinksMenu.LoadXml(linkMenuXML);
The menu builds just fine but the urls are all relative.
example: NavigateUrl = "www.telerik.com" but the href="http://localhost:5011/www.telerik.com"
I tried using the HrefBaseDir property with no luck. Am I missing something? The threads that give the HrefBaseDir property as a solution are all 3 years old or older from what I found. Is there an updated propery I should use? The following is an example fuction that builds the linkMenuXML string:
private string getLinksXmlString()
{
List<Links> LinksList = new List<Links>();
string xmlString = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><Menu EnableEmbeddedSkins=\"false\" HrefBaseDir=\"\" Skin=\"NavBarSkin\" EnableScreenBoundaryDetection=\"false\"><Group><Item Text=\"Links\"><Group Flow=\"Vertical\">";
//putting stuff in the list
for (int i = 0; i < 10; i++)
{
Links temp = new Links();
temp.Name = "Link Number " + i.ToString();
temp.NavigateUrl = "www.telerik.com";
LinksList.Add(temp);
}
foreach (Link link in LinksList)
{
xmlString += "<Item Text=\"" + link.Name + "\" HrefBaseDir=\"\" NavigateUrl=\"" + link.NavigateUrl + "\"></Item>";
}
xmlString += "</Group></Item></Group></Menu>";
return xmlString;
}
Thank you in advance for any help you can provide!
I realize there are a large number of threads on similar topics. However, none of the solutions I was able to find have worked.
I am given a list of structs from a function that accesses a database. The structs hold the absolute url path to a web site (potentially to an external site) and the desired text value of the link. I use the information in this list to construct a string that holds the xml needed to render the rad menu control. I do this so I can store the string as a session variable so I only need to access the database once. I then bind the menu to the string:
string linkMenuXML = Session["quicklinkXML"].ToString();
LinksMenu.LoadXml(linkMenuXML);
The menu builds just fine but the urls are all relative.
example: NavigateUrl = "www.telerik.com" but the href="http://localhost:5011/www.telerik.com"
I tried using the HrefBaseDir property with no luck. Am I missing something? The threads that give the HrefBaseDir property as a solution are all 3 years old or older from what I found. Is there an updated propery I should use? The following is an example fuction that builds the linkMenuXML string:
private string getLinksXmlString()
{
List<Links> LinksList = new List<Links>();
string xmlString = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><Menu EnableEmbeddedSkins=\"false\" HrefBaseDir=\"\" Skin=\"NavBarSkin\" EnableScreenBoundaryDetection=\"false\"><Group><Item Text=\"Links\"><Group Flow=\"Vertical\">";
//putting stuff in the list
for (int i = 0; i < 10; i++)
{
Links temp = new Links();
temp.Name = "Link Number " + i.ToString();
temp.NavigateUrl = "www.telerik.com";
LinksList.Add(temp);
}
foreach (Link link in LinksList)
{
xmlString += "<Item Text=\"" + link.Name + "\" HrefBaseDir=\"\" NavigateUrl=\"" + link.NavigateUrl + "\"></Item>";
}
xmlString += "</Group></Item></Group></Menu>";
return xmlString;
}
Thank you in advance for any help you can provide!