RandV80 0 Newbie Poster

I posted a problem here a while ago on this topic, but had to put my project off to the side and never really got it resolved. But I have a better understanding of the problem and a clearer idea of what I need to do (I think :) ).

I've started building a very basic website. It has a header, content, and footer sections set up in the .master file, with separate .aspx files for the content section, organized in a .sitemap file.

Using asp: SiteMapPath and asp:Menu controls, I've setup site navigation the standard with the standard method. Except I want to accomplish this using Button controls, not a menu, and am having a hard time figuring this out. I see two ways to accomplish this:

1. Set it up in the button declaration. When I create the asp:Menu, the parameter that links to the SiteMap is DataSourceID="SiteMapDataSource1". Is there something similar I can do in the button declaration? I tried adding that line into it but it doesn't work.

2. Set it up programmatically. On msdn, I've found some examples of how you can access the SiteMap programmatically. The following code from msdn, for example:

protected void btnButton1_Click(object sender, EventArgs e)
{
    Response.Write(SiteMap.RootNode.Title + "<br />");
    Response.Write(SiteMap.RootNode.Url + "<br />");
}

Will tell me which SiteMapNode I'm in when when Button1 is clicked. I've been digging further to see if I can use this to actually navigate to a node, but haven't been able to find anything yet. Is this possible?

Any help would be appreciated, last time around helped but I wasn't actually able to click the "Solved" button.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.