Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
Page Class
Page Methods
 InitializeCulture Method
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
Page..::.InitializeCulture Method

Updated: November 2007

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

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

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

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.

Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, 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.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Implementing InitializeCulture() method in a SharePoint application      Rathinavel Subramanian   |   Edit   |  

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();
}
}

Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker