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: 1/17/2006 9:58:57 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 47 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
Big Chod
Asp.Net User
SiteMapNode Contructor Parameters1/17/2006 9:58:57 AM

0/0

Hi

I have created a custom SQL SiteMapProvider.  I need to localize this and was hoping to do so in the same way I have localized the content for the rest of the site.

When I dynamically add my nodes i first create a new node using the following constructor

public SiteMapNode (
    SiteMapProvider provider,
    string key,
    string url,
    string title,
    string description,
    IList roles,
    NameValueCollection attributes,
    NameValueCollection explicitResourceKeys,
    string implicitResourceKey

as is found here: http://msdn2.microsoft.com/en-us/library/ms150104.aspx

Ideally I want to declare my resource keys explicitly.  Using the XmlProvider this value is set in the "title" as a value inside the title atttribute.  I dont think the same would be the case here as the title is seperate.  So does anyone know what key/values pairs neeed to be passed as a NameValueCollection into the explicitResourceKeys parameter to get this to work. I have tried all the obvious combinations and noe seem to work.

Thanks in  advance to anyone that can help me.

The Big Chod

dannychen
Asp.Net User
Re: SiteMapNode Contructor Parameters1/18/2006 4:51:00 PM

0/0

Chod,

  If I understand you correctly, ideally you would like to be able to set the various resources that your sitemapnode might use through code.  Unfortunately, this isn't possible.  The implicitResourceKey and explicitResourceKeys parameters are meant to be used in conjunction with with the existing resources system. 

  These parameters might be more easily understood with comparable examples in XmlSiteMapProvider. 

<siteMapNode resourceKey="foo" />    <-- this sets the implicitResourceKey parameter to "foo"

<siteMapNode title="$resources: k,v" />  <-- this sets an entry in the explicitResourceKey's NameValue collection.  "title" -> "k.v"

--
Danny

 


disclaimer: Information provided is 'as is' and conveys no warranties or guarantees.
Big Chod
Asp.Net User
Re: SiteMapNode Contructor Parameters1/19/2006 4:01:41 PM

0/0

Thanks for the reply.  I don't understand why this cannot be done though

I inherit from StaticSiteMapProvider...It has a reourcekey and EnableLocalization property.  Surely if is set these as I would in the xml provider as you have suggested then it should work.  Here is my Overriden method BuildSiteMap()

public override SiteMapNode BuildSiteMap()

{

this.EnableLocalization = true;

this.ResourceKey = "SiteMapLocalizations";

MapNodeInfo rootNodeInfo;

MapNodeList nodeList;

// Map already built

if (m_root != null) return m_root;

// Query the database for site map nodes

nodeList = MapNodeList.GetMapNodeList();

rootNodeInfo = nodeList.Root;

if (rootNodeInfo != null)

{

m_root = new SiteMapNode(this,

rootNodeInfo.ID.ToString(),

rootNodeInfo.Url,

rootNodeInfo.Title,

rootNodeInfo.Description);

m_root.Roles = new string[] { "*" };

AddNode(m_root, null);

}

foreach (MapNodeInfo info in nodeList)

{

if (info.Parent > 0)

{

SiteMapNode node = new SiteMapNode(this,

info.ID.ToString(),

info.Url,

"Default Text",

info.Description

);

node.ResourceKey = info.Description;

AddNode(node, FindSiteMapNodeFromKey(info.Parent.ToString()));

}

}

// Return the root SiteMapNode

return m_root;

}

When I first visit my site in debug mode and step through I can see that the necessary resorces are being pulled from my Globalisation database.  These are then added to the resource cache.  But some reason only the default is being displayed.

In the theory if the XML provider can do this then so can a class inheriting from the StaticSiteMapProvider.  If this is not the case then how do people internationalize a site if they need to build there own custom provider?

 

 

 

 

 

 

dannychen
Asp.Net User
Re: SiteMapNode Contructor Parameters1/20/2006 12:46:37 AM

0/0

Sorry, I misunderstood what you wanted to do.  What you are describing should work, what I wanted to say won't work is passing in the localized values into the node itself.  If the localized values are stored in the globalization system then yes, you can put resource identifiers into your nodes.  They should work exactly like they would with the XmlSiteMapProvider. 

If you have a value for resourceKey that works in XmlSiteMapProvider, setting the resourceKey value in the constructor should work the same way. 

--
Danny


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


Free Download:


Web:
SiteMapNode Contructor Parameters - ASP.NET Forums Re: SiteMapNode Contructor Parameters. 01-18-2006, 11:51 AM. Contact ... Re: SiteMapNode Contructor Parameters. 01-19-2006, 11:01 AM ...
using System; using System.Collections.Generic; using System.Text ... Contructor used to create a stadard instance which modifies the ... The parameters required to be added to the URL ...
ASP.NET Development May 13, 2006 ... Returning Output Parameters using a TableAdapter · public variable or friend? ... siteMapNode Question · typed datasets - dataset ...
http://the3factory.com/post/2008/05/How-to-access-an-exchange ... ... 2008-05-07 monthly http://the3factory.com/post/2008/05/Unable-to-connect- incorrect-log-on-parameters.aspx 2008-05-06 monthly ...
sri blog: List of .net questions asked in MNC'S If there is no contructor provided compiler invokes the default constructor. the Moment ..... what are the attributes of sitemapnode? Title,url,description ...
Archive 2008-05-03, how to change report name based on multi valued parameter, 0 ..... 2008-05-02, run an exe from command promt and passing parameter to it, 0 ...
MCTS(70-528) Web-Based Client Development Figure 1-5 Configure the FTP parameters for Web site access. ...... The SiteMapNode object represents a node in the site map and has proper ties called ...
sri blog: List of .net questions asked in MNC'S If there is no contructor provided compiler invokes the default constructor. the Moment ..... what are the attributes of sitemapnode? Title,url,description ...
Archive 2008-05-03, how to change report name based on multi valued parameter, 0 ..... 2008-05-02, run an exe from command promt and passing parameter to it, 0 ...
MCTS(70-528) Web-Based Client Development Figure 1-5 Configure the FTP parameters for Web site access. ...... The SiteMapNode object represents a node in the site map and has proper ties called ...




Search This Site:










how do you place your controls on a new module?

how not to install dnn 3.0.10

forms authentication cookie never expires

aspx pages cause an automatic log-off in child portals

cannot create user - website configurations

automatic login detection

new housemenu beta

how to log user login and logout details? with asp.net ,c# and sql server 2000

log viewer problem after upgrade to 310 from 3013

finding records in memberrole table

how to publish web app?

can vwd use xml schemas ?

failed to start database server.??

menu in asp.net

errors uploading modules

treeview icons and lines can't be together?

editor and ie7b1

clipmarks, next wave?

connecting through frontpage extensions causing account lock out - i think

windows authentication and user details using asp .net 2.0

userid to other table

circular references issue

windows authentification setup help

|datadirectory| in default not being recognised anymore

which config file is on the top?

property editor control?

veritcal menus ie6

master pages across solutions

two menu's

urgent help needed - cannot upload skin

 
All Times Are GMT