Culture

Hello,

I am working with VS 2008 and ASP.NET 3.5.

In my Web.Config file I have the following:

<globalization culture="pt-PT" uiCulture="pt-PT"/>

I suppose this sets the default culture of my web site.

All pages in my web site inherits from a master page named Base.

How can I, in Base.Master VB code, change the culture from the default
value to EN instead of changing in each page?

Thanks,
Miguel
Shapper [ Mi, 16 April 2008 02:58 ] [ ID #1943400 ]

Re: Culture

"shapper" <mdmoura [at] gmail.com> wrote in message
news:34676756-f524-4f49-86ff-495af8d3b46e [at] 24g2000hsh.googleg roups.com...
> Hello,
>
> I am working with VS 2008 and ASP.NET 3.5.
>
> In my Web.Config file I have the following:
>
> <globalization culture="pt-PT" uiCulture="pt-PT"/>
>
> I suppose this sets the default culture of my web site.

Yes. And it also states "no matter what the user wants, give him the default
language". Change to auto:pt-PT for both.

> All pages in my web site inherits from a master page named Base.
>
> How can I, in Base.Master VB code, change the culture from the default
> value to EN instead of changing in each page?

me.Page.UICulture = ""

me.Page.Culture = ""

And set the proper name. This can be done in any event.

If you also want to change theme, you will have to do it in OnPreInit in the
base class. I believe you also have to bury master page changes here, as
well.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
NoSpamMgbworld [ Mi, 16 April 2008 18:34 ] [ ID #1943509 ]
Microsoft » microsoft.public.dotnet.framework.aspnet » Culture

Vorheriges Thema: Add Css File
Nächstes Thema: Check login status