Asp.net

如何在 web.sitemap 中實現本地化

  • July 12, 2019

你能解釋一下如何在 web.sitemap 中實現本地化嗎?

使用全域資源文件。

App_GlobalResources\Web.sitemap.resx

然後使用 web.sitemap 中的鍵,例如;

<siteMapNode url="somepage.aspx" title="Name"  resourceKey="PageName"/>

如果你有全球資源,你可以像這樣使用它

<siteMapNode url="~/Default.aspx" Title="$resources:SiteMapLocalizations,HomePageTitle"></siteMapNode>

其中 SiteMapLocalizations: 是資源名稱 HomePageTitle: 你的資源鍵

參考:http: //msdn.microsoft.com/en-us/library/ms178427.aspx

引用自:https://stackoverflow.com/questions/614484