[英]How to determine if a Publishing Page in Sharepoint 2007 is actually published
[英]How to localize SharePoint publishing page title
如何本地化SharePoint發布頁面的頁面標題? 我將其設置為:
PublishingPage newPage = publishingWeb.GetPublishingPages().Add("mypage.aspx", "mylayout.aspx");
newPage.Title = "$Resources:MYRESX,MyPage_PageTitle";
newPage.Update();
當我設置此頁面時,標題$Resources:MYRESX,MyPage_PageTitle
顯示$Resources:MYRESX,MyPage_PageTitle
,而不是SharePoint查找字符串。 因此,我想我的假設是SharePoint將查找字符串是錯誤的。 或者我的語法錯誤。
我已經在其他地方引用過MYRESX
; 我確定資源文件/字符串可以訪問。
我也對Webpart標題有完全相同的問題,因此希望針對這兩種情況都存在一個統一的解決方案。
嘗試SPUtility.GetLocalizedString :
newPage.Title =
SPUtility.GetLocalizedString(
"$Resources:MyPage_PageTitle",
"MYRESX",
web.Language);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.