Hi,
I have a Publishing site. I am trying to a create a custom left navigation in Visual webpart..
I am trying to show the pages inside the subsite..
I have tried the below code:
SPNavigationNodeCollection nodecollec = oweb.Navigation.QuickLaunch; foreach (SPNavigationNode ppage in nodecollec) { if (ppage.Url.ToLower() != "pages/default.aspx") { string nodeVAl = ht[ppage.Title.ToLower()].ToString(); pageCount++; sbContent.Append("<LI>"); sbContent.Append("<a href='" + web.Url + "/" + ppage.Url + "'>" + ppage.Title + "</a>"); sbContent.Append("</LI>"); } }
The pages are coming properly, but the URL is not getting properly formed..
Example:
Correct URL: http://server/sites/ParentSite/ChildSite/Pages/Ppp2.aspx
I am now getting URL as: http://server/sites/ParentSite/sites/ParentSite/ChildSite/Pages/Ppp2.aspx
How to fix this?