'SiteMap' does not contain a definition for 'CurrentNode'?

Not sure what happens but I can't access all SiteMap's properties. I'm using Ajax-enabled site and applied a Master Page.

 What I'm trying to do is change current node title at run time and I saw some posts:

SiteMapNode currentNode = SiteMap.CurrentNode.Clone(true);
SiteMapNode tempNode = currentNode;

tempNode.Title = "xx";
tempNode.Description = "xx";

Thanks in advance,

Frank

 

The following is the error message:

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0117: 'SiteMap' does not contain a definition for 'CurrentNode'

0
frankhsu
8/31/2007 12:49:56 AM
asp.net.navigation-controls 13714 articles. 0 followers. Follow

8 Replies
502 Views

Similar Articles

[PageSpeed] 32

Hmmm... it should be working. There is indeed a CurrentNode property of a SiteMap. Are you sure your SiteMap is correctly declared? So the type information is correct?

Also, I don't think you will need to clone the current node, as this information is typically read-only. I mean, if you change the title of the current node, it will not be persisted in the web.sitemap file. 


If this post was useful to you, please mark it as answer. Thank you!
0
johram
8/31/2007 10:27:27 PM

Just make sure how to correctly declare?? import System.Web and just use SiteMap?

 The reason I'm doing this is because I only have one aspx page that will load and display one specific product details based on the girdview that's in the previous page and I want my sitemap currentNode to display the specific product's itemNo.

0
frankhsu
9/2/2007 4:32:52 PM

Are you sure the page you are using when retrieving the current node exists in the site map? 

0
Lance
9/3/2007 4:33:53 AM

I'm sure that my page is in my Web.sitemap

0
frankhsu
9/3/2007 4:42:55 PM

If your file is named something other than Web.Sitemap, you have to explicitly configure the provider to read the renamed file.  Has that been done? 

0
Lance
9/3/2007 4:55:23 PM

Do you have a page called "SiteMap.aspx"? If so, the code-behind/beside class will also be called "SiteMap", which will conflict with the System.Web.SiteMap class. Try changing your code to: 

SiteMapNode currentNode = System.Web.SiteMap.CurrentNode.Clone(true);
  
0
RichardD
9/3/2007 6:23:13 PM

 D'oh!


If this post was useful to you, please mark it as answer. Thank you!
0
johram
9/5/2007 9:04:46 AM

Yes! My parter named a page called "SiteMap.aspx" which I didn't notice it. Once I removed the page, the problem is solved.

 Thx! RichardD

0
frankhsu
9/8/2007 12:50:29 AM
Reply:

Similar Artilces:

''''''''''''''''''''
Name: haznen Email: haznenatyahoodotcom Product: Gran Paradiso Alpha 8 Summary: '''''''''''''''''''' Comments: '''''''''''''''''''''''''''''''''''' Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061204 UGES/1.7.2.0 GranParadiso/3.0a1 From URL: http://www.mozilla.org/projects/granparadiso/ Note to readers: Hendrix gives...

'''''
Name: mario Email: ramar17atfastwebnetdotit Product: Gran Paradiso Alpha 2 Summary: ''''' Comments: K: Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a2) Gecko/20070206 GranParadiso/3.0a2 ...

'do' won't 'do' if '/'
Greetings to All from Au, Have a NetWare Perl 5.8.4 and wanted to tweak File\Spec\NW.pm to try and standardise on '/' separators. If I run a test script (t/uni/lower.t) with an unmodified NW.pm, it calls t/uni/case.pl, that, in case.pl, (when the path separators are '\'), the $file is '..\lib\unicore\To\Lower.pl' and the following code portion works, with $simple getting a returned table: sub casetest { my ($base, $spec, $func) = @_; my $file = File::Spec->catfile(File::Spec->catdir(File::Spec->updir, "lib", &qu...

'''
Name: L Lachowsky Email: e2brutus_10atyahoodotcom Product: Firefox Summary: ''' Comments: why duddn this surprise me... I change default server from IE to Mozilla, and then i get error messages. well, shud I decide to not get on my computer with Mozilla..or shud I risk security breeches with IE....hmmm at least i can get on the internet with IE Browser Details: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this fee...

Cast from type ''''DBNull'''' to type ''''String'''' is not valid.
How do I avoid getting this error: Cast from type ''''DBNull'''' to type ''''String'''' is not valid. I am trying to get values from the database into a form for updating using a Datareader, SQL is set to allow nulls for certain fields as they are not required but the only way I can get the form to display is by adding a space in SQL. Is there another way around this? Check if it is equal to DBNull.Value first and if it is, don't do the cast.Stanley Tan theSpoke Blog Where in the code does it need to go? I am using the following and it's the profile that isn't always requi...

table_info('','','','%') cannot return any types
I was recently confirming table_info special cases and discovered the case for getting table_types cannot work. table_info('','','','%') should return a list of table types but it returns a list of empty strings instead: my @types = $h->tables('', '', '', '%'); print "all types:\n", join("xxx\n", @types), "\n"; # should output something like: # "dbo" # "INFORMATION_SCHEMA" # "sys" # and actually outputs: xxx xxx It seems to be down to the following ...

'Roles' does not contain a definition for 'GetUsersInRole'
 Dear All, I do not know why it happend to my website suddenly!   I did not have any error now it keeps get errors and do not know any definition for Roles!!!! something like this:  if (Roles.IsUserInRole(theUser, "x")) there is blue underline under 'isUserInRole' ??!!!!   Thanks for your helps in advance, Regards, Salma Happy coding........ Hi sali1982, It's really strange that you suddenly get the problem. I think you first need to check whether you've enabled role in web.config. Also, you need to check whether ...

'IN' Clause or 'OR'
Hello, [1]: select * from TABLEA where COL1 IN('value1','value2''valu3'....) [2]:select * from TABLEA where COL1 = 'value1' OR COL1= 'value2' OR COL1='valu3'. TABLEA is a huge table and it has non-clustered index on COL1. Among the above 2 queries, which query will give me the better performance or fast response and WHY? What is the difference between 'IN' and 'OR' clauses as for as Sybase Optimization is concerned. Which is the better one to be used on huge tables. Thanks. Mac An IN list is treated ...

'b'..'a'
Hello. I'm using defferent 5.6.0's for Win32. I wonder wheter following behaviour is intentional or not: d:\>perl -e "print 'b'..'c'" bc d:\>perl -e "print 'b'..'a'" bcdefghijklmnopqrstuvwxyz I expected empty list in latter case, like in perl -e "print 'bb'..'a'" <!ENTITY Vadim REALLIFE "Vadim V.Konovalov, St.Petersburg, Russia"> &Vadim; On Wed, Sep 20, 2000 at 03:14:41PM +0400, Konovalov, Vadim wrote: > Hello. > > I'm using defferent 5.6.0'...

'double' does not contain a definition for 'Format'
I'm getting an error saying double does not contain a definition for "FORMAT" any ideas... <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Web.UI.HtmlControls" %> <%@ Import Namespace="System.Web.UI.HtmlControls" %> <script language="c#" runat="server"> void Calculate_Click(Object sender, EventArgs e) { int loanPrincipal = Convert.ToInt32(Request.Form["loanPrincipal"]); int loanTaxes = Convert.ToInt32(Request.Form["loanTaxes"]); int loanInsur...

'or' or 'union'
Hello I was just wondering, in general what is better to use, an 'or' clause in a select or a 'union' to join two selects together. Do both statements create work tables? Many thanks Alex I think OR will be better than union. because suppose u have 3 tables and using OR u can join table a and table b and table c so each table will have only one read. but using union you will join table a and table b and in another query of union u will use table (a or b) and table c so ur one read is more in union . Ramdas Alex Cheung wrote: > Hello > >...

'type' does not contain a definition for 'length'
Could anybody help me with this, thanks so much //Copyright (C) 2000 Microsoft Corporation. All rights reserved. // Hello1.cs public class Hello1 { int OneToZero(int[] args) { int iCount = 0; for (int i=0; i < args.length ; i++) { if (args[i] == 1) { iCount++; args[i] = 0; } } return iCount; } public static void Main(string[] args) { int[] iArr = {1, 3, 4, 5, 1, 1, 7}; Hello1 test = new Hello1(); int iNumOnes; System.Console.WriteLine("Values of the array: [ "); ...

'_Master' does not contain a definition for 'Context'
 its first time happening to me. i have only one file in my asp.net website. the Master pagethis is the code behind class of this master pagenamespace Asif.Website{    public partial class _Master : System.Web.UI.MasterPage    {                    }}  when i publish this website it reports an error '_Master' does not contain a definition for 'Context' When i remove the "Namespace" and class is without namespace it works fin...

'CreditCard' does not contain a definition for 'GetCreditCardDetails'
In my Confirm.aspx page I am using a method from a dll. In VS 2005 sometimes when I compile my project(web site) in which the dll is a part of the solution it gives me following error,Confirm.aspx.cs(220): error CS0117: 'CreditCard' does not contain a definition for 'GetCreditCardDetails' I verified many times that the method exists. To solve the errror I have to remove the dll from the bin and give reference again. Yesterday I deployed the dll and didn't receive any error while compilation. But received error after accessing Confirm.aspx. Can someone please hel...

Web resources about - 'SiteMap' does not contain a definition for 'CurrentNode'? - asp.net.navigation-controls

Resources last updated: 12/17/2015 7:22:19 PM