CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 7/8/2005 1:40:17 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 42 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
aarnott
Asp.Net User
BUG: SiteMapNodeCollection(SiteMapNodeCollection) constructor fails7/8/2005 1:40:17 PM

0/0

I'll make a small test case and file this, but in the meantime, does MS already know about this? 

I am writing a descending class of the XmlSiteMapProvider, and in the GetChildNodes method
that I'm overriding, I first call base.GetChildNodes, which returns a ReadOnlySiteMapNodeCollection. 
But I need to modify it, so I call the copy constructor of SiteMapNodeCollection, which leaves me with
this error.

Server Error in '/Web' Application.

Specified cast is not valid.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Specified cast is not valid.

Source Error:

Line 29: 			if (evaluationPage != null && childNodes.Contains(evaluationPage))
Line 30: {
Line 31: SiteMapNodeCollection myChildNodes = new SiteMapNodeCollection(childNodes);
Line 32: int index = myChildNodes.IndexOf(evaluationPage);
Line 33: myChildNodes.Remove(evaluationPage);

Source File: c:\Documents and Settings\ala55\My Documents\iFolder\wc\RelateInstitute\Web\App_Code\QuestionnaireSiteMapProvider.cs    Line: 31

Stack Trace:

[InvalidCastException: Specified cast is not valid.]
System.Web.SiteMapNodeCollection.System.Collections.ICollection.CopyTo(Array array, Int32 index) +12
System.Collections.ArrayList.InsertRange(Int32 index, ICollection c) +130
System.Collections.ArrayList.AddRange(ICollection c) +14
System.Web.SiteMapNodeCollection..ctor(SiteMapNodeCollection value) +112
Byu.Fhss.Sfl.RelateInstitute.Web.Providers.QuestionnaireSiteMapProvider.GetChildNodes(SiteMapNode node) in c:\Documents and Settings\ala55\My Documents\iFolder\wc\RelateInstitute\Web\App_Code\QuestionnaireSiteMapProvider.cs:31
System.Web.SiteMapNode.get_ChildNodes() +19
System.Web.UI.WebControls.SiteMapDataSource.GetNodes() +361
System.Web.UI.WebControls.SiteMapDataSource.GetPathNodeCollection(String viewPath) +36
System.Web.UI.WebControls.SiteMapDataSource.GetView(String viewName) +34
System.Web.UI.WebControls.SiteMapDataSource.System.Web.UI.IDataSource.GetView(String viewName) +7
System.Web.UI.WebControls.Repeater.ConnectToDataSourceView() +304
System.Web.UI.WebControls.Repeater.OnLoad(EventArgs e) +17
System.Web.UI.Control.LoadRecursive() +49
System.Web.UI.Control.LoadRecursive() +132
System.Web.UI.Control.LoadRecursive() +132
System.Web.UI.Control.LoadRecursive() +132
System.Web.UI.Control.LoadRecursive() +132
System.Web.UI.Control.LoadRecursive() +132
System.Web.UI.Control.LoadRecursive() +132
System.Web.UI.Control.LoadRecursive() +132
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3695


Version Information: Microsoft .NET Framework Version:2.0.50215.44; ASP.NET Version:2.0.50215.44


Andrew L Arnott
.NET Compact Framework
dannychen
Asp.Net User
Re: BUG: SiteMapNodeCollection(SiteMapNodeCollection) constructor fails7/11/2005 4:22:49 PM

0/0

aarnot:
  It looks like this is a bug that was fixed.  I ran this code and it failed with your exception on Beta2 but works for me in the latest bits. 

protected void Page_Load(object sender, EventArgs e)

{

SiteMapNodeCollection me = SiteMap.CurrentNode.ChildNodes;

SiteMapNodeCollection foo = new SiteMapNodeCollection(me);

}

--
Danny


disclaimer: Information provided is 'as is' and conveys no warranties or guarantees.
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
BUG: SiteMapNodeCollection(SiteMapNodeCollection) constructor ... BUG: SiteMapNodeCollection(SiteMapNodeCollection) constructor fails ... Re: BUG: SiteMapNodeCollection(SiteMapNodeCollection) constructor fails ...
Commonality - Wednesday, 24 May 2006 In one of the constructors for the NamespaceTranslatorStream class, a new XmlTextReader .... SiteMapNodeCollection collection = new SiteMapNodeCollection( ); ...
Live XML feeds support – RadRotator An exception when trying to bind to SiteMapNodeCollection is now fixed. ...... from a form's constructor may cause the viewer to "Generating Report. ...
John Luif - Blog Post //this is an unbound column thus the second param in the constructor ..... SiteMapNodeCollection nodes = parentNode.ChildNodes;. for (int i = nodes. ...
ASP.NET Security Membership Role Management The security check immediately failed when it detected that the calling ...... the node is not included in a SiteMapNodeCollection returned to the user, ...
From [email protected] Sun Aug 1 03:46:08 2004 From ... + static bool useEditable; -#region Constructors + static XPathDocument () + { + ...... Web/SiteMapNodeCollection.cs System.Web/SiteMapProvider.cs System. ...
Top Network - Web Hosting, Development, Content Management - News ...
  • A bug with EnableMultiSelect and AutoPostBackOnDayClick not ...... Arial">An exception when trying to bind to SiteMapNodeCollection is now fixed. ...
    ASP.NET Security Membership Role Management The security check immediately failed when it detected that the calling ...... the node is not included in a SiteMapNodeCollection returned to the user, ...
    From [email protected] Sun Aug 1 03:46:08 2004 From ... + static bool useEditable; -#region Constructors + static XPathDocument () + { + ...... Web/SiteMapNodeCollection.cs System.Web/SiteMapProvider.cs System. ...
    Top Network - Web Hosting, Development, Content Management - News ...
  • A bug with EnableMultiSelect and AutoPostBackOnDayClick not ...... Arial">An exception when trying to bind to SiteMapNodeCollection is now fixed. ...




  • Search This Site:









     
    All Times Are GMT