SiteMap.CurrentMode property not available

  • Thread starter Richard Carpenter
  • Start date
R

Richard Carpenter

I am trying to dynamically set the page title in the form load event of
my master page, but the CurrentNode property doesn't seem to be
available for some reason in the following code, the SiteMap object is
available to me and intellisense shows many methods and properties for
it, but CurrentNode is not in the list. However, I don't get any
indication at design time that it would cause an error. When I try to
run the code, I get the error:
"Error 1 'System.Web.UI.WebControls.SiteMapDataSource' does not contain
a definition for 'CurrentNode'"

Here is the code:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class TestApp : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
if (SiteMap.CurrentNode == null)
{
PageTitle.Text = "";
}
else
{
PageTitle.Text = SiteMap.CurrentNode.Title;
}

}
}

I have read that the .Net Framework 1.1 did not support the CurrentNode
property for the SiteMap object, but I am using the following version
of the dev environment:

Microsoft Visual Studio 2005
Version 8.0.50727.42 (RTM.050727-4200)
Microsoft .NET Framework
Version 2.0.50727

Installed Edition: Standard

Microsoft Visual Basic 2005 77633-235-0794681-41159
Microsoft Visual Basic 2005

Microsoft Visual C# 2005 77633-235-0794681-41159
Microsoft Visual C# 2005

Microsoft Visual C++ 2005 77633-235-0794681-41159
Microsoft Visual C++ 2005

Microsoft Visual J# 2005 77633-235-0794681-41159
Microsoft Visual J# 2005

Microsoft Visual Web Developer 2005 77633-235-0794681-41159
Microsoft Visual Web Developer 2005

DirectX extensions for Visual Studio
DirectX extensions for Visual Studio .NET

Any insight would be greatly appreciated.

Rich
 
R

Richard Carpenter

Richard said:
I am trying to dynamically set the page title in the form load event of
my master page, but the CurrentNode property doesn't seem to be
available for some reason in the following code, the SiteMap object is
available to me and intellisense shows many methods and properties for
it, but CurrentNode is not in the list. However, I don't get any
indication at design time that it would cause an error. When I try to
run the code, I get the error:
"Error 1 'System.Web.UI.WebControls.SiteMapDataSource' does not contain
a definition for 'CurrentNode'"

Here is the code:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class TestApp : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
if (SiteMap.CurrentNode == null)
{
PageTitle.Text = "";
}
else
{
PageTitle.Text = SiteMap.CurrentNode.Title;
}

}
}

I have read that the .Net Framework 1.1 did not support the CurrentNode
property for the SiteMap object, but I am using the following version
of the dev environment:

Microsoft Visual Studio 2005
Version 8.0.50727.42 (RTM.050727-4200)
Microsoft .NET Framework
Version 2.0.50727

Installed Edition: Standard

Microsoft Visual Basic 2005 77633-235-0794681-41159
Microsoft Visual Basic 2005

Microsoft Visual C# 2005 77633-235-0794681-41159
Microsoft Visual C# 2005

Microsoft Visual C++ 2005 77633-235-0794681-41159
Microsoft Visual C++ 2005

Microsoft Visual J# 2005 77633-235-0794681-41159
Microsoft Visual J# 2005

Microsoft Visual Web Developer 2005 77633-235-0794681-41159
Microsoft Visual Web Developer 2005

DirectX extensions for Visual Studio
DirectX extensions for Visual Studio .NET

Any insight would be greatly appreciated.

Rich

Nevermind, folks. I walked away from it for a while and came back later
to take another stab at it. That was when I noticed I was referencing
the SiteMapDataSource rather than the actual SiteMap. The devil's in
the details.

Thanks anyway.
Rich
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top