declaring Protected Overrides Sub InitializeCulture() once for allhttp://forums.asp.net/t/961074.aspx/1?declaring+Protected+Overrides+Sub+InitializeCulture+once+for+allFri, 24 Mar 2006 15:14:45 -05009610741192270http://forums.asp.net/p/961074/1192270.aspx/1?declaring+Protected+Overrides+Sub+InitializeCulture+once+for+alldeclaring Protected Overrides Sub InitializeCulture() once for all Page.InitializeCulture Method cannot be setup/overriden in a MasterPage<br> <br> Is there any alternative solution to declaring same &quot;Protected Overrides Sub InitializeCulture()&quot; in every page of a globalized website?<br> 2006-02-08T18:23:56-05:001201083http://forums.asp.net/p/961074/1201083.aspx/1?Re+declaring+Protected+Overrides+Sub+InitializeCulture+once+for+allRe: declaring Protected Overrides Sub InitializeCulture() once for all <p>Create a new class and derive it from&nbsp; System.Web.UI.Page. In this class override InitializeCulture(). Then derive all your other Pages from this new class. For example:</p> <p>public partial class localizedPage : System.Web.UI.Page<br> {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;protected override void InitializeCulture()<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;....<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.....<br> }</p> <p>public partial class myPage : localizedPage</p> <p>{<br> &nbsp;&nbsp;&nbsp;...<br> }</p> 2006-02-17T06:02:33-05:001219417http://forums.asp.net/p/961074/1219417.aspx/1?Re+declaring+Protected+Overrides+Sub+InitializeCulture+once+for+allRe: declaring Protected Overrides Sub InitializeCulture() once for all thank you<br> I cannot have this working..<br> <br> this is the new class I created:<br> <br> <i>Imports Microsoft.VisualBasic<br> Imports System.Threading<br> Imports System.Globalization<br> Public Class localizedPage<br> &nbsp;&nbsp;&nbsp; Inherits System.Web.UI.Page<br> &nbsp;&nbsp;&nbsp; Protected Overrides Sub InitializeCulture()<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim UserCulture As String = Profile.GetPropertyValue(&quot;PreferredCulture&quot;).ToString()<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If UserCulture &lt;&gt; &quot;&quot; Then<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Thread.CurrentThread.CurrentUICulture = New CultureInfo(UserCulture)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(UserCulture)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br> &nbsp;&nbsp;&nbsp; End Sub<br> End Class<br> </i><br> and this is the Error:<br> <i>'GetPropertyValue' is not a member of 'Profile'<br> <br> </i>please note the italic part is exaclty what I have in every and each page (working...) and would like not to repeat but to derive once for all. Where do I miss?<br> <br> <br> 2006-03-07T16:32:48-05:001219976http://forums.asp.net/p/961074/1219976.aspx/1?Re+declaring+Protected+Overrides+Sub+InitializeCulture+once+for+allRe: declaring Protected Overrides Sub InitializeCulture() once for all <p>check these out</p> <p><a href="/1219973/ShowPost.aspx">http://forums.asp.net/1219973/ShowPost.aspx</a></p> <p><a href="/1219954/ShowPost.aspx">http://forums.asp.net/1219954/ShowPost.aspx</a></p> <p><a href="/1199336/ShowPost.aspx">http://forums.asp.net/1199336/ShowPost.aspx</a></p> <p>HTH!</p> 2006-03-08T03:58:14-05:001220039http://forums.asp.net/p/961074/1220039.aspx/1?Re+declaring+Protected+Overrides+Sub+InitializeCulture+once+for+allRe: declaring Protected Overrides Sub InitializeCulture() once for all <p>Hi.</p> <p>This is what I do. I use a property named &quot;Language&quot; to store the users preference. Place this code in your new class (localizedPage) and derive all the other pages from this class. Should work.</p> <font color="#0000ff" size="2"> <p>protected</font><font size="2"> </font><font color="#0000ff" size="2">override</font><font size="2"> </font><font color="#0000ff" size="2">void</font><font size="2"> InitializeCulture()</p> <p>{</p> <p></p> <p></font><font color="#0000ff" size="2">string</font><font size="2"> cCulture = </font> <font color="#800000" size="2">&quot;&quot;</font><font size="2">;</p> <p></font><font color="#008080" size="2">ProfileCommon</font><font size="2"> objProfile = (</font><font color="#008080" size="2">ProfileCommon</font><font size="2">)</font><font color="#008080" size="2">HttpContext</font><font size="2">.Current.Profile;<br> </font><font color="#0000ff" size="2">if</font><font size="2">(objProfile.Language != </font><font color="#0000ff" size="2">null</font><font size="2">)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cCulture = objProfile.Language;</p> <font color="#0000ff" size="2"> <p>if</font><font size="2"> (cCulture.Length &gt; 0)<br> {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Threading.</font><font color="#008080" size="2">Thread</font><font size="2">.CurrentThread.CurrentCulture = System.Globalization.</font><font color="#008080" size="2">CultureInfo</font><font size="2">.CreateSpecificCulture(cCulture);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Threading.</font><font color="#008080" size="2">Thread</font><font size="2">.CurrentThread.CurrentUICulture = </font><font color="#0000ff" size="2">new</font><font size="2"> System.Globalization.</font><font color="#008080" size="2">CultureInfo</font><font size="2">(cCulture);<br> }</p> <p></font><font color="#0000ff" size="2">base</font><font size="2">.InitializeCulture();</font></p> <p><font size="2">}</p> </font></font> 2006-03-08T06:16:31-05:001220174http://forums.asp.net/p/961074/1220174.aspx/1?Re+declaring+Protected+Overrides+Sub+InitializeCulture+once+for+allRe: declaring Protected Overrides Sub InitializeCulture() once for all Hi Flo1973,<br> <br> <i>Imports Microsoft.VisualBasic<br> Imports System.Threading<br> Imports System.Globalization<br> <br> Public Class localizedPage<br> &nbsp;&nbsp;&nbsp; Protected Overloads Overrides Sub InitializeCulture()<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim cCulture As String = &quot;&quot;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim objProfile As ProfileCommon = CType(HttpContext.Current.Profile, ProfileCommon)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Not (objProfile.Language Is Nothing) Then<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cCulture = objProfile.Language<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If cCulture.Length &gt; 0 Then<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture(cCulture)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Threading.Thread.CurrentThread.CurrentUICulture = New System.Globalization.CultureInfo(cCulture)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MyBase.InitializeCulture()<br> &nbsp;&nbsp;&nbsp; End Sub<br> <br> End Class</i><br> <br> Errors:<br> 1) sub initializeculture cannot be declared ovverrides because it does not override a sub in a base class<br> 2) language is not a member of profilecommon<br> 3) initializecluture is not a member of objects<br> <br> Hi Rob,<br> I would prefer not to rely on cookies <br> <br> regards<br> <br> Luca<br> <br> 2006-03-08T09:59:22-05:001220213http://forums.asp.net/p/961074/1220213.aspx/1?Re+declaring+Protected+Overrides+Sub+InitializeCulture+once+for+allRe: declaring Protected Overrides Sub InitializeCulture() once for all Hi Flo1973,<br> <br> <i>Imports Microsoft.VisualBasic<br> Imports System.Threading<br> Imports System.Globalization<br> <br> Public Class localizedPage<br> &nbsp;&nbsp;&nbsp; Protected Overloads Overrides Sub InitializeCulture()<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim cCulture As String = &quot;&quot;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim objProfile As ProfileCommon = CType(HttpContext.Current.Profile, ProfileCommon)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Not (objProfile.Language Is Nothing) Then<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cCulture = objProfile.Language<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If cCulture.Length &gt; 0 Then<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture(cCulture)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Threading.Thread.CurrentThread.CurrentUICulture = New System.Globalization.CultureInfo(cCulture)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MyBase.InitializeCulture()<br> &nbsp;&nbsp;&nbsp; End Sub<br> <br> End Class</i><br> <br> Errors:<br> 1) sub initializeculture cannot be declared ovverrides because it does not override a sub in a base class<br> 2) language is not a member of profilecommon<br> 3) initializecluture is not a member of objects<br> <br> Hi Rob,<br> I would prefer not to rely on cookies <br> <br> regards<br> <br> Luca<br> <br> 2006-03-08T10:51:36-05:001220217http://forums.asp.net/p/961074/1220217.aspx/1?Re+declaring+Protected+Overrides+Sub+InitializeCulture+once+for+allRe: declaring Protected Overrides Sub InitializeCulture() once for all <font size="1"> <blockquote><span class="icon-blockquote"></span> <h4>Flo1973</h4> </font> <p><font size="1">Create a new class and derive it from&nbsp; System.Web.UI.Page. In this class override InitializeCulture(). Then derive all your other Pages from this new class. For example:</font></p> <p><font size="1">public partial class localizedPage : System.Web.UI.Page<br> {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;protected override void InitializeCulture()<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;....<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.....<br> }</font></p> <p><font size="1">public partial class myPage : localizedPage</font></p> <p><font size="1">{<br> &nbsp;&nbsp;&nbsp;...<br> }</font></p> <p><font size="1"></p> </blockquote> <p></p> <p><font size="1">This only works if the page that sets the profile is dedicated. In order to set the profile you need some sort of an input control. This page will then be ALWAYS ONE CULTURE BEHIND, in the history of changing cultures. It is kind of ok, it is just one page exception to the rule. This one page can be done&nbsp;DIRECTLY, via the Request.Form collection&nbsp;as described&nbsp;in</font><span style="font-size:10pt; font-family:Arial"><font size="1">&nbsp;</font></span><span style="font-size:10pt; font-family:Arial"><font size="1"><a href="http://download.microsoft.com/download/3/6/0/3604c3d2-0db9-4726-910d-b3b8f93a86e4/hilo_localization_final.wmv">this video demo</a></font></span><font size="1">, just set the profile too.</font></p> <p><font size="1">It is not the form of persistence(you chose the profile, which is fine) but the fact that InitializeCulture() occurs early on when there are no controls yet, so whichever the persistence medium, it would be reading yesterdays news. </font></p> <p><font size="1">You can build&nbsp;the dropwdown into the OO hierarchy. Its(any control's) members are not available yet for the InitializeCultue method, so you need to use the Request.Form collection. This is a real coupled solution though and limited as to UI templating. </font></p> <p><font size="1">Putting&nbsp;the dropdown to be in the MasterPage. Then every page becomes the exception to the rule. </font>See the links I pointed to for a solution.</p> <p>Another way to solve this is a design with&nbsp;iframes(frown, frown). Then the parent page with the dropdwon set the cullture directly. The child page loads properly because that request occurs after the parent. The child page can use OO and&nbsp;of the ways of persistence.&nbsp;As a matter of fact I use complex navigational system and not to repost it, I keep it in the parent page. Frames are a huuuge hassle though, and far from best practices. MSDN&nbsp;uses&nbsp;frames because the navigational system requires it, but they are not for the faint at heart.</p> <p>Bottom line what you are asking for is not simple but doable. Under all scenarios it is either coupled or brittle, which is why Microsoft&nbsp;didn't offer it as a canned feature. Microsoft pushes the &quot;AUTO&quot; feature which essentially persists in a browser setting which is always available early on, and if switched, it occurs BEFORE the request, as it is done in the browser GUI and not even the page itself. We all agree &quot;auto&quot; is the lamest of all, until they expose the browser setting to scripting, which will be NEVER, for security reasons.</p> </font> 2006-03-08T11:00:07-05:001220228http://forums.asp.net/p/961074/1220228.aspx/1?Re+declaring+Protected+Overrides+Sub+InitializeCulture+once+for+allRe: declaring Protected Overrides Sub InitializeCulture() once for all <p><font size="1"></p> <blockquote><span class="icon-blockquote"></span> <h4>lucasp</h4> I would prefer not to rely on cookies</blockquote> </font> <p></p> <p><font size="1">Luca, it is not the cookies. You can use any of the persistence forms you like. </font></p> <p><font size="1">BTW, what do you think profile uses by default? Last I looked, http is still disconnected so you still need to identify yourself on every request.</font></p> <p><font size="1">Look for&nbsp;the stats for users that accept cookies? Virtually 100% :)</font></p> 2006-03-08T11:15:20-05:001220241http://forums.asp.net/p/961074/1220241.aspx/1?Re+declaring+Protected+Overrides+Sub+InitializeCulture+once+for+allRe: declaring Protected Overrides Sub InitializeCulture() once for all <p>Hi Rob.</p> <p>I agree, and this is what I do. I have got a dropdown control for choosing the language in my masterpage. When the selection index is changed, then in set the new profile value and reload the page. Sorry, I forgot to mention this...</p> <p>Regards, Florian</p> 2006-03-08T11:31:25-05:001220246http://forums.asp.net/p/961074/1220246.aspx/1?Re+declaring+Protected+Overrides+Sub+InitializeCulture+once+for+allRe: declaring Protected Overrides Sub InitializeCulture() once for all Hi<br> I suppose there must be many methods to get to the same result.<br> I also understand some are more &quot;elegant&quot;.<br> <br> Anyway, as I am a newbie it is easyer for me (for ANY newbie) to start from something already achieved (with, trust me, strain and good will) than to re-start every time following the daily guru's suggestion<br> <br> Now, the method I have managed to write down.. works<br> <br> (that is unbelievable... I know, but it does)<br> <br> What I need at the moment is to solve this problem: how can I declare MY methods once for all, as at the moment I need to repeat it for any and each page.<br> <br> I understand there is a huge world outside but also I must be very practical: I need to solve THIS problem at the moment: thanks for any effective help <br> <br> The story so far:<br> bilingual website: english and italian<br> english is default language, as I want people coming from abroad to have website shown in english UNLESS they are italian<br> <br> that is why in my config.sys I wrote<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;globalization culture=&quot;auto:en-US&quot; uiCulture=&quot;auto:en-US&quot;/&gt;<br> <br> now, I also need visitors to be able to switch language in spite of their browsers' settings<br> <br> that is why I also have a <br> &lt;asp:ImageButton OnClick=&quot;Flag_Click&quot; CommandArgument=&quot;it-IT&quot;...<br> &lt;asp:ImageButton OnClick=&quot;Flag_Click&quot; CommandArgument=&quot;en-US...<br> <br> on my master page.<br> <br> ok<br> <br> Now things come.some more complicated:<br> I have a bar menu on my master page.<br> menu must (of course) be bilingual too.<br> <br> So I resolved to have TWO different masterpages<br> <ul> <li>a visitor enters the site </li><li>server questions visitor's browser for preferred language </li><li>depending on browser's response the correct master page is loaded </li><li>depending on language preferences, resulting global/Localresources are loaded </li><li>in spite of automated preferences, clicking on a language flag .gif allow visitor to switch language </li></ul> and I managed to have this working<br> <br> again, I am sure I haven't made it in the most elegant way.. but you know I am a neewbie, so I hope I can deserve some mercy<br> <br> Now I just would like not to have to write down some 20 lines in each page but to have the possibility to write down a class to be simply inherited<br> <br> this is the code-behind I have to write in each page, at the moment:<br> <br> <i>Imports System.Threading<br> Imports System.Globalization<br> Partial Class myclass</i><i><br> &nbsp;&nbsp;&nbsp; Inherits System.Web.UI.Page<br> &nbsp;&nbsp;&nbsp; Protected Overrides Sub InitializeCulture()<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim UserCulture As String = Profile.GetPropertyValue(&quot;PreferredCulture&quot;).ToString()<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If UserCulture &lt;&gt; &quot;&quot; Then<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Thread.CurrentThread.CurrentUICulture = New CultureInfo(UserCulture)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(UserCulture)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br> &nbsp;&nbsp;&nbsp; End Sub<br> &nbsp;&nbsp;&nbsp; Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim stLang<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stLang = Request.ServerVariables(&quot;HTTP_ACCEPT_LANGUAGE&quot;)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stLang = stLang.Substring(0, 2)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim UserCulture As String = Profile.GetPropertyValue(&quot;PreferredCulture&quot;).ToString()<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If UserCulture = &quot;&quot; Then<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If stLang = &quot;it&quot; Then<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Me.MasterPageFile = &quot;territorio_it.master&quot;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Else<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Me.MasterPageFile = &quot;territorio.master&quot;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ElseIf UserCulture = &quot;it-IT&quot; Then<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Me.MasterPageFile = &quot;territorio_it.master&quot;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Else<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Me.MasterPageFile = &quot;territorio.master&quot;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br> &nbsp;&nbsp;&nbsp; End Sub<br> End Class<br> <br> </i>This is a fully funtional example, you can just copy it and it will work: I hope at least it can be of some help to other newbie.<br> <br> If anybody knows how to include this code in a class in order not to have to copy it in each and any page of my website.. this is what I need at the moment and you are welcome<br> <br> Luca<br> <br> p.s. I do not know if it is clear: I prefer (when possible, of course) VB examples<br> anyway I do love http://www.developerfusion.co.uk/utilities/convertcsharptovb.aspx<br> 2006-03-08T11:37:54-05:001236760http://forums.asp.net/p/961074/1236760.aspx/1?Re+solutionRe: solution Here's the (working) solution to my question: I found it on an Italian Forum.<br> Hope it can be of some help to some other fellows..<br> <br> Protected Overrides Sub InitializeCulture()<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim CurrentContext As HttpContext = HttpContext.Current<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim UserCulture As String = CurrentContext.Profile.GetPropertyValue(&quot;PreferredCulture&quot;).ToString()<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If UserCulture &lt;&gt; &quot;&quot; Then<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Thread.CurrentThread.CurrentUICulture = New CultureInfo(UserCulture)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(UserCulture)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br> &nbsp;&nbsp;&nbsp; End Sub<br> <br> 2006-03-24T15:14:45-05:00