Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Customized Left Navigation - URL not getting properly formed

$
0
0

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?

Thanks


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>