.aspxページのカルチャを変更できません。予想通り.aspxページのカルチャを変更できません
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="VideoPlayerPrototype.Index" Culture="ur-PK" UICulture="ur-PK" %>
すべてが動作します。私が先頭にページディレクティブを使用して文化を指定
。
私がしたいのは、ユーザーがリンクをクリックしたときにローカライゼーションを変更できることです。
リンク:
<asp:ImageButton ID="lang_ur-PK"
ImageUrl="~/content/image/flag-of-pakistan.png"
runat="server"
CssClass="language"
Height="64px"
Width="64px"
OnClick="setLanguage" />
setLanguage方法:このコードを呼び出す
protected void setLanguage(Object sender, EventArgs e)
{
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("ur-PK");
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("ur-PK");
Response.Redirect(Request.Path);
}
だけでページをリロードし、正しい言語をロードしません。
私はApp_LocalResourcesとApp_GlobalResourcesに保存された.resxファイルを持っている:
Index.aspx.resx、Index.aspx.en.resx、Index.aspx.ur-PK.resx、Index.aspx.ur.resxを
<asp:Label id="lblInfoWelcomeMsg" runat="server"
Text="<%$ Resources:LocalizedText, Summary_Info_WelcomeMsg %>"></asp:Label>
が応答リダイレクトを行うことで、あなた
これは、[msdnページ](http://msdn.microsoft.com/en-us/library/bz9tc508.aspx)で、これを行う方法と、投稿データを使用する際の問題点について説明しています –