[RESOLVED] How to get SiteMapPath1's Current FullPath Displaying Text

question seems simple but I couldnt find a way.
so How can I get SiteMapPath1's Current Displaying Text ?

It renders to page display,the full path from root to current .I can see at page like this "HomePage>>Blah>>Blah" but I cannot get this text.

should I write a for loop to get parent node till to rootnode ? or is there an ready property that I can get this displayingtext value ?

(thanks)

ofsure I did this functionality via a primitive recurrency loop function.

what if I bump this question as covering its orginal may help some ?
I  am missing a property something like this ?:

a=SiteMapPath1.RenderedText;

?


Hi,

hcetiner

question seems simple but I couldnt find a way.
so How can I get SiteMapPath1's Current Displaying Text ?

If you use SiteMapPath and conjunction with the SiteMapDataSource or SiteMapPath, you can get the current node by SiteMap.CurrentNode 

Like:

private void Page_Load(object sender, System.EventArgs e)
{
    // Examine the CurrentNode, and navigate the SiteMap relative to it.
    Response.Write(SiteMap.CurrentNode.Title + "<br />");
    Response.Write("<font COLOR='red'>" + SiteMap.CurrentNode.Url + "</font><br />");

}

About SiteMap class, Simply speaking, it is a container for a hierarchical collection of SiteMapNode objects. You can check this link:

http://msdn.microsoft.com/en-us/library/system.web.sitemap.aspx

Hope this can help you.

the SiteMapPath doesn't expose this as a single piece of text. The way it works it out is to start at the current mode and use ParentNode upwards until ParentNode is null.

If you just want the text then you could wrap the SiteMapPath in another control, such as a server div and extract the InnerHtml, or a Panel and get the inner controls.

need WISWIG (What I see What I Get).Need Full path.the displayingtext

thoughts on "[RESOLVED] How to get SiteMapPath1's Current FullPath Displaying Text "

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>