我對此設置的CultureInfo按鈕Main.Master頁面,並將其存儲在會話:如何獲取會話信息或當前文化信息在非頁面後面的包裝類?
protected void RU_Click(object sender, ImageClickEventArgs e)
{
Session["MyCulture"] = CultureInfo.CreateSpecificCulture("ru-Ru");
Server.Transfer(Request.Url.LocalPath);
}
protected void USA_Click(object sender, ImageClickEventArgs e)
{
Session["MyCulture"] = CultureInfo.CreateSpecificCulture("en-AU");
Server.Transfer(Request.Url.LocalPath);
}
我寫我非頁面背後的包裝類,並在這個類我需要從會議上得到這個文化。我嘗試在這個班上獲得像這樣的當前文化信息:
(CultureInfo)HttpContext.Current.Session["MyCulture"]
但是HttpContext.Current
是NULL!這怎麼解決?
這個代碼是小..... PLZ更explain.it不possiable – ashkufaraz
這哪裏是「背後的包裝類非頁」? – Oded
我有我的帶班的解決方案創建一個C#類庫文件(.dll)(.NET Framework 3.5的)項目。在一個班級中,我嘗試獲取當前的文化信息。我怎麼能得到它? –