Page Methods


.NET Framework Class Library
Page..::.InitializeCulture Method

Sets the Culture and UICulture for the current thread of the page.

Namespace:  System.Web.UI
Assembly:  System.Web (in System.Web.dll)
Syntax

Visual Basic (Declaration)
Protected Overridable Sub InitializeCulture
Visual Basic (Usage)
Me.InitializeCulture()
C#
protected virtual void InitializeCulture()
Visual C++
protected:
virtual void InitializeCulture()
JScript
protected function InitializeCulture()
Remarks

The InitializeCulture method contains no coding logic. Control developers extending the functionality of the Page class can override the InitializeCulture method to initialize the Culture and UICulture information for the page.

Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 3.5, 3.0, 2.0
See Also

Reference

Tags :


Community Content

Rathinavel Subramanian
Implementing InitializeCulture() method in a SharePoint application

In ASP .Net application, InitializeCulture() method of the Page class will be called by the sub classes generated by the compiler.

But in the .Net application hosted in the SharePoint Server, InitializeCulture() method is not being called by the sub classes generated or by the Compiler. So if you implement InitializeCulture() method in a SharePoint application, make sure you call the InitializeCulture() method from the Constructor of the class.

Example,

namespace SPLibrary {

public class Default : Microsoft.SharePoint.WebPartPages.WebPartPage {

public Default() {

this.InitializeCulture();
}

protected override void InitializeCulture() {

Thread.CurrentThread.CurrentCulture = new CultureInfo("ta-IN");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("ta-IN");
base.InitializeCulture();
}
}


Page view tracker