I have a website with Page A and Page B
There is a link on page B page Now I am trying to make changes in breadcrumb navigation which is a custom user control. ATM I am trying to check whether the user has navigated from Page A and then has created this navigation and if not navigated any other navigation has not been created. Using this property, I know that a user coming from is fine now the problem is that The page / web map I want to create or receive a site is navigated by a user so that I can add this page B title to this kind of breadcrumb navigation below, Page A & Gt; Page B Or may be Page C & gt; Page C.1 & gt; Page C.2 & gt; Page B I am using this code, But it is not working properly, I tried to debug it, but because I'm unable to get the site / web page map, I Get a site map from here, my question is, how can I get a map map of the website from which I am navigating so that I get another node from "Sitikem". Add as "Page B" I can use it to get the site map of the current page, but I do not want to use it because this sitemap will give the sitemap as the site C; Site C.1 ... & gt; Site B Cheers To obtain breadcrumb navigation ... code of No need 1) Web sitemap 2) ASPX can get through the tab of the page If you want ... I will show you the sample code ...?
Request.UrlReferrer.ToString ()
string default breadcrumb HTML = "& lt; span & gt; & lt; one class = \" ms -sitemapdirectional \ "href = \" {0} \ "& gt; {1} & lt; / span & gt;"; String default spam printing = "> "; Secure Zero Page_Old (Object Sender, EventAgds E) {try {SiteMapProvider contentMapProvider = SiteMap.Providers ["SPContentMapProvider"]; StringBuilder GeneratedHTML = New StringBuilder (); Generated HTML.Append ("& lt; div class = \" ms-globallinks TopBreadcrumbs \ "& gt;"); If (contentMapProvider! = Null) {SiteMapNode currentNode = contentMapProvider.FindSiteMapNode (Request.UrlReferrer.ToString ()); If (currentNode! = Null) {string [] breadcrumbTitles = new string [20]; ; String [] breadcrumbUrls = new string [20]; Int count = 0; If (currentNode == contentMapProvider.RootNode) {breadcrumbTitles [0] = currentNode.Title; BreadcrumbUrls [0] = currentNode.Url; } Else {while (currentNode! = ContentMapProvider.RootNode) {if (Request.UrlReferrer.ToString ()) is included ("Page A") {breadcrumbTitles [count] = "Page B"; BreadcrumbUrls [count] = string.Format ("www.Gohome.com \ PageB.aspx"); Count ++; } Breadcrumbtitles [count] = presentnode.title; BreadcrumbUrls [count] = currentNode.Url; If (currentNode.ParentNode! = Null) {currentNode = currentNode.ParentNode; Count ++; } And {break} }} BreadcrumbTitles [count] = currentNode.Title; BreadcrumbUrls [count] = currentNode.Url; } While (calculation> = 0) {generated HTML.Append (string.Format (defaultBreadcrumbHtml, breadcrumbUrls [count], breadcrumbTitles [count])); If (count! = 0) {generatedHTML.Append (defaultSpacingHtml); } Count--; } Generated HTML.Append ("& lt; / div & gt;"); Html.ext = Generated HTML.ToString (); }}
Comments
Post a Comment