CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 3/29/2006 2:09:02 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 2 Views: 140 Favorited: 0 Favorite
3 Items, 1 Pages 1 |< << Go >> >|
Fixme2
Asp.Net User
SiteMapNode.Attributes - protected??3/29/2006 2:09:02 PM

0

Hi all

Regarding the Attributes property of the SiteMapNode class. Quoting from the .NET library reference:

SiteMapNode remarks: "Finally, a NameValueCollection collection of additional Attributes attributes is available to site map providers that use SiteMapNode objects, but require additional properties that are not available in the base SiteMapNode class."

Attributes remarks: "The Attributes collection is typically used when you need to apply additional attributes to a site map node, but do not want to derive a custom class in order to do so."

.. Well and good. Actually, I need to access such additional attributes in my SiteMapNodes. And I would rather not have to derive a custom class. Only it transpires that the Attributes collection is protected. And hence available to derived classes only (barring reflection of course)! What gives? Is this simply a mistake by Microsoft or what?

Fixme2
Asp.Net User
Re: SiteMapNode.Attributes - protected??3/29/2006 7:58:27 PM

0

Ah, slightly embarassed here..

Turns out the SiteMapNode class has an indexer that accesses the attributes - and with localization support, too. As in

string blah = mySiteMapNode["blah"]

Now that's beautiful.

danielfernandes
Asp.Net User
Re: SiteMapNode.Attributes - protected??6/4/2007 1:23:21 PM

0

I wouldn't say it's beautiful because this means it's not possible to easily inherit from a SitemapNode class because we can't access this Attributes property.

Apart from using Reflection I am not sure how I am going to solve my problem (custom formatting for Title attribute configured directly in the Sitemap file)... 

3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Beginning ASP.NET 3.5 in VB 9.0: From Novice to Professional Authors: Matthew MacDonald, Pages: 1149, Published: 2007
Pro ASP.NET 2.0 in VB 2005: From Professional to Expert Authors: Laurence Moroney, Matthew MacDonald, Pages: 1253, Published: 2006
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1255, Published: 2005
Pro ASP.NET 2.0 in C# 2005: Create Next-generation Web Applications with the Latest Version of Microsoft's Revolutionary Technology Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1426, Published: 2006
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
Professional ASP.NET 2.0 Databases Authors: Thiru Thangarathinam, Pages: 504, Published: 2007
Beginning ASP.NET 2.0 in VB 2005: From Novice to Professional Authors: Matthew MacDonald, Pages: 1063, Published: 2006
Pro ASP.NET for SQL Server: High Performance Data Access for Web Developers Authors: Brennan Stehling, Pages: 408, Published: 2007
Professional ASP.NET 3.5: In C# and VB Authors: Bill Evjen, Scott Hanselman, Devin Rader, Pages: 1673, Published: 2008
Beginning ASP.NET 2.0 in C# 2005: From Novice to Professional Authors: Matthew MacDonald, Pages: 1148, Published: 2006

Web:
SiteMapNode.Attributes Property (System.Web) A NameValueCollection of additional attributes for the SiteMapNode beyond ... The protected Attributes attribute does not perform in the same manner as the ...
SiteMapNode.Attributes - protected?? - ASP.NET Forums SiteMapNode remarks: "Finally, a NameValueCollection collection of additional Attributes attributes is available to site map providers that ...
Use of SiteMapNode.Attributes ? - telerik Forum However, the Attributes collection in SiteMapNode is protected and we could not map custom SiteMapNode attributes to a MenuItem property. ...
Nine ASP.NET Site Navigation Problem Solutions: Part 1 The repeater may then access the siteMapNode element's attributes, .... Then simply declare and set a couple of protected properties in the code-behind: ...
Binding to custom web.sitemap attributes - -[Danny Chen]- Blog of ... Web.sitemap allows for custom attributes to be added to each SiteMapNode. ... Protected Sub TreeView1_TreeNodeDataBound(ByVal sender As Object, _ ...
Feedback: SiteMapNode should have Public Attributes -- not protected. Instead of forcing us to enherit SiteMapNode just to expose Attributes NameValueCollection -- please make it accessible from the get go. ...
pulse: SitemapNode Moreover, the SitemapNode may contain a set of attributes which may be used during XSL transformation ... Deprecated. protected constructor for Hibernate. ...
SiteMapNode Members (System.Web) Protected method, GetExplicitResourceString, Retrieves a localized string based on a SiteMapNode attribute to localize, a default string to return if no ...
Koders Code Search: SiteMapNode.cs - C# Web { public class SiteMapNode : IHierarchyData, INavigateUIData, .... #region Field Accessors protected NameValueCollection Attributes { get { return ...
using System; using System.Collections.Generic; using System.Linq ... protected SiteMapNode GetSiteMapNodeFromXMLElement(XElement node). {. // Get the URL attribute, need this so we can get the key. ...






sitemap,,treeview and how to hide nodes

how can i add the user control to treeview nodes

accessing label in contentplaceholder in masterpage from a page

menu control - dynamicmenustyle not rendering correctly when specifying css

firefox displays page correct - ms internet-explorer not ?!

site editor with master pages

how to have a webpage url 'auto-fill' a contentplaceholder?

parallel tree views

sitemapprovider cannot be found

navigation menu template

where is the theme gallery?

code behind the masterpage don't execute

i can find no vendors selling pre-designed and browser tested layouts??

another question about treeview

maintain treeview state between pages

javascript in masterpage's childpage's content

hi, i want to add controls to a certain panel which is in my master page is it possible?

css for theme works in iis but not asp.net development server

master pages css problem

menu

problem with masterpage

asp menu performance issue

ugly masterpage markup fix?

adding nodes to a sitemappath programatically

treeview: selectednodechanged, how do i capture what i have selected ?

'sitemap' does not contain a definition for 'currentnode'?

where to start

readmore button

binding a site map data source to a database

web user control in master pages

   
  Privacy | Contact Us
All Times Are GMT