Last post May 07, 2009 07:50 AM by Dave Sussman
May 06, 2009 06:10 AM|luicst|LINK
How to use Multi-Language on MasterPage ?
行 1: <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" Culture="auto" UICulture="auto" %>行 2: 行 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Thank you very much !
May 06, 2009 07:15 AM|qwe123kids|LINK
To make Localization ..
Check the Video..
hope it helps
May 07, 2009 01:57 AM|luicst|LINK
System.Web.UI.MasterPage has not 'culture' public property.
So MaterPage.master can not use same method as default.aspx to complete localization.
May 07, 2009 03:05 AM|skrish08820|LINK
Master page is merged with the content page before rendering. What are you trying to do? If you have some controls that you want to change programmatically, you can:
1) use this.Master.FindControl () to get them and modify them as you feel
2) create public properties through which you can set them in the master page
May 07, 2009 07:50 AM|Dave Sussman|LINK
If you want the localization set for all pages, then consider using a global event and storing the selection, perhaps in the Profile. See
http://quickstarts.asp.net/QuickStartv20/aspnet/doc/localization/default.aspx for lots of localization topics. For a global event, I use the Application_PreRequestHandlerExecute, for example:
void Application_PreRequestHandlerExecute(object sender, EventArgs e)
// set up the thread's culture before the handler executes
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(Profile.UICulture);
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture(Profile.Culture);
This assumes the selected locale is stored in a Profile property, but it could equally be a session object or some other cache. Using this method sets the locale for every page, so avoids having to modify any other pages.