Pages

Setting culture at page and codebehind

 

Setting culture with C#
protected override void InitializeCulture()
{
if (Request.Form["DropDownList1"] != null)
{
// Define the language
UICulture = Request.Form["DropDownList1"];
// Define the formatting (requires a specific culture)
Culture = Request.Form("DropDownList1");
}
base.InitializeCulture();
}

Also if you want to do this setting from page without dont write anything in c# code you can just write this top of the page
<%@ Page UICulture="es" Culture="es-MX" %>

Hiç yorum yok: