2013-03-07 53 views
0
  1. 創建文件資源:「Master」。
  2. 將它放在App_GlobalResources目錄中,
  3. 添加鍵 - Menu_Contact。
  4. 創建另一個文件資源:「Master.he」。
  5. 添加鍵 - Menu_Contact。
  6. 將線程文化設置爲「he-IL」。本地化ASPX標記不起作用

    System.Threading.Thread.CurrentThread.CurrentCulture = 
        System.Threading.Thread.CurrentThread.CurrentUICulture = 
        (System.Globalization.CultureInfo)Session["Calture"]; 
    
  7. 添加標記到aspx文件:

下面是測試的標記和行:

<a href="#"> 
    <% Response.Write(Resources.Master.Menu_Contact); %> 
    <asp:Label runat="server" Text='<%$Resources:Master,Menu_Contact%>'></asp:Label> 
</a> 

第一個選項工作,該標記不是。 有什麼不對?

+0

你能指定你在哪裏設置文化(在哪個事件中)。你應該在'InitializeCulture' – Danish 2013-03-07 11:36:01

回答

0

這是我的問題。我修好了它。 現在我在InitializeCulture上設置文化,它的工作!