<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Getting Started</title><link>http://forums.asp.net/15.aspx</link><description>The perfect forum for ASP.NET novices. No question too simple! &lt;A href="http://aspadvice.com/SignUp/list.aspx?l=21&amp;amp;c=17" target=_blank&gt;Email List&lt;/A&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Where to set/change page's culture prior to FrameworkInitialize()?</title><link>http://forums.asp.net/thread/1154488.aspx</link><pubDate>Thu, 29 Dec 2005 17:17:31 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1154488</guid><dc:creator>Fredrik N</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1154488.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=1154488</wfw:commentRss><description>&lt;p class=MsoNormal&gt;It was my fault, you are absolutely right Brock. It will work at the PreRequestHandlerExecute. I was confused when I read the other thread where he posted the “Session state is not available in this context" message and the code of the Application_PreRequestHandlerExecute. I assumed the problem was that he tried to use the Session within an event where the Session wasn’t ready to be used yet, like the Application_Start etc.&lt;/p&gt;
&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=MsoNormal&gt;So thanks Brock for pointing this out.&lt;/p&gt;</description></item><item><title>Re: Where to set/change page's culture prior to FrameworkInitialize()?</title><link>http://forums.asp.net/thread/1154325.aspx</link><pubDate>Thu, 29 Dec 2005 15:05:40 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1154325</guid><dc:creator>BrockAllen</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1154325.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=1154325</wfw:commentRss><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/default/images/icon-quote.gif"&gt; &lt;strong&gt;Fredrik N wrote:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; 
&lt;p class=MsoNormal&gt;&lt;span&gt;At the &lt;font size=2&gt;PreRequestHandlerExecute&amp;nbsp;&lt;/font&gt;the&lt;span&gt;&amp;nbsp;&lt;/span&gt;Session variables is not yet available for use.&lt;/span&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p class=MsoNormal&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class=MsoNormal&gt;Actually Fredrik, this is incorrect. Session *is* available in PreRequestHandlerExecute. The HttpApplication fires AcquireRequestState, PostAcquireRequestState then the PreRequestHandlerExecute event. Either PostAcquireRequestState or PreRequestHandlerExecute would be valid locations to use Session. The other is Application_AcquireRequestState in global.asax, as the events there are guaranteed to be called after any modules event handlers.&lt;/p&gt;
&lt;p class=MsoNormal&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class=MsoNormal&gt;-Brock&lt;/p&gt;
&lt;p class=MsoNormal&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Where to set/change page's culture prior to FrameworkInitialize()?</title><link>http://forums.asp.net/thread/1154262.aspx</link><pubDate>Thu, 29 Dec 2005 14:12:36 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1154262</guid><dc:creator>martin.</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1154262.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=1154262</wfw:commentRss><description>Works great with the profile feature. Thank you very much!</description></item><item><title>Re: Where to set/change page's culture prior to FrameworkInitialize()?</title><link>http://forums.asp.net/thread/1154122.aspx</link><pubDate>Thu, 29 Dec 2005 09:15:22 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1154122</guid><dc:creator>Fredrik N</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1154122.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=1154122</wfw:commentRss><description>&lt;p class=MsoNormal&gt;&lt;span&gt;At the &lt;font size=2&gt;PreRequestHandlerExecute&amp;nbsp;&lt;/font&gt;the&lt;span&gt;&amp;nbsp;&lt;/span&gt;Session variables is not yet available for use. What you can do is to store the culture into a cookie or maybe if you already use the Profile feature, you can use it to store the language a user has selected. You can also instead of the PreRequestHandlerExecute try to use the &lt;font face="Courier New" size=2&gt;Application_AcquireRequestState.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=MsoNormal&gt;&lt;span&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class=MsoNormal&gt;&lt;span&gt;Take a look at the following posts:&lt;/span&gt;&lt;/p&gt;
&lt;p class=MsoNormal&gt;&lt;span&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class=MsoNormal&gt;&lt;span&gt;&lt;a href="http://fredrik.nsquared2.com/viewpost.aspx?PostID=153"&gt;http://fredrik.nsquared2.com/viewpost.aspx?PostID=153&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=MsoNormal&gt;&lt;span&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class=MsoNormal&gt;&lt;span&gt;&lt;a href="http://fredrik.nsquared2.com/viewpost.aspx?PostID=309"&gt;http://fredrik.nsquared2.com/viewpost.aspx?PostID=309&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Re: Where to set/change page's culture prior to FrameworkInitialize()?</title><link>http://forums.asp.net/thread/1153802.aspx</link><pubDate>Wed, 28 Dec 2005 22:24:23 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1153802</guid><dc:creator>martin.</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1153802.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=1153802</wfw:commentRss><description>&lt;p&gt;I can't&amp;nbsp;get it to work when I want to set the prefered languange in global.asax. I've tried both memberships and session. Membership always i nothing, and when I try to use sessions i get the error "Session state is not available in this context" &lt;/p&gt;
&lt;p&gt;What am i doing wrong here?&lt;/p&gt;
&lt;p&gt;This is in my global.asax in &lt;font size=2&gt;Application_PreRequestHandlerExecute&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;font color=#0000ff size=2&gt;If&lt;/font&gt;&lt;font size=2&gt; Session(&lt;/font&gt;&lt;font color=#800000 size=2&gt;"culture"&lt;/font&gt;&lt;font size=2&gt;) &lt;/font&gt;&lt;font color=#0000ff size=2&gt;IsNot&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Nothing&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Then&lt;br /&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Try&lt;br /&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Dim&lt;/font&gt;&lt;font size=2&gt; ci &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;New&lt;/font&gt;&lt;font size=2&gt; Globalization.CultureInfo(Session(&lt;/font&gt;&lt;font color=#800000 size=2&gt;"culture"&lt;/font&gt;&lt;font size=2&gt;).ToString)&lt;br /&gt;System.Threading.Thread.CurrentThread.CurrentUICulture = ci&lt;br /&gt;System.Threading.Thread.CurrentThread.CurrentCulture = ci&lt;br /&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Catch&lt;/font&gt;&lt;font size=2&gt; ex &lt;/font&gt;&lt;font color=#0000ff size=2&gt;As&lt;/font&gt;&lt;font size=2&gt; Exception&lt;br /&gt;System.Threading.Thread.CurrentThread.CurrentUICulture = &lt;/font&gt;&lt;font color=#0000ff size=2&gt;New&lt;/font&gt;&lt;font size=2&gt; System.Globalization.CultureInfo(&lt;/font&gt;&lt;font color=#800000 size=2&gt;"sv-se"&lt;/font&gt;&lt;font size=2&gt;)&lt;br /&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;End&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Try&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;font color=#0000ff size=2&gt;End&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;If&lt;/font&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;</description></item><item><title>Re: Where to set/change page's culture prior to FrameworkInitialize()?</title><link>http://forums.asp.net/thread/1067931.aspx</link><pubDate>Fri, 30 Sep 2005 08:31:42 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1067931</guid><dc:creator>wpclueless</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1067931.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=1067931</wfw:commentRss><description>I have tried this and it works for a listbox selection and a button, but when I try it using an image button it fails in the application_prerequesthandlerexecute saying that session state in not available in this context - any ideas why?</description></item><item><title>Re: Where to set/change page's culture prior to FrameworkInitialize()?</title><link>http://forums.asp.net/thread/939671.aspx</link><pubDate>Sat, 28 May 2005 03:36:18 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:939671</guid><dc:creator>blackpuppy</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/939671.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=939671</wfw:commentRss><description>First, your resx files need to be named like this (notice the dot before resx):&lt;br&gt;
&lt;blockquote&gt;
Register.aspx.en-CA.resx&lt;br&gt;

Register.aspx.fr-CA.resx&lt;br&gt;
&lt;/blockquote&gt;

I guess they are just typos.&lt;br&gt;
&lt;br&gt;
My Global.asax is shown below.&lt;br&gt;
&lt;br&gt;
&lt;blockquote&gt;&lt;font color="#0000ff"&gt;&amp;lt;%@ Application Language="C#" %&amp;gt;&lt;br&gt;
&amp;lt;%@ Import Namespace="System.Globalization" %&amp;gt;&lt;br&gt;
&amp;lt;%@ Import Namespace="System.Threading" %&amp;gt;&lt;br&gt;
  &lt;br&gt;
&amp;lt;script RunAt="server"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; // other methods are ommitted for brevity.&lt;br&gt;
  &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void Application_PreRequestHandlerExecute(object sender, EventArgs e)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string lang = (string)Session["Language"];&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
//Page.Culture = lang;&amp;nbsp; // This does not work!&amp;nbsp; Must assign
Thread.CurrentThread.CurrentUICulture!&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thread.CurrentThread.CurrentUICulture =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new CultureInfo(lang);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catch&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&amp;lt;/script&amp;gt;&lt;/font&gt;&lt;br&gt;
&lt;/blockquote&gt;You do not need to write the prototype yourself.&amp;nbsp; You
can let Visual Studio do that for you.&amp;nbsp; There are two dropdown
list
above the code pane.&amp;nbsp; In the left dropdown list, select
"&lt;font color="#0000ff"&gt;Application&lt;/font&gt;".&amp;nbsp; And then in the right dropdown list, select the
event handler you want such as "&lt;font color="#0000ff"&gt;PreRequestHandlerExecute&lt;/font&gt;".&amp;nbsp; The
event handler stub will be created for you.&amp;nbsp; Then you can write
your code inside.&lt;br&gt;
&lt;br&gt;
Hope this is of some use to you.&lt;br&gt;
&lt;br&gt;</description></item><item><title>Re: Where to set/change page's culture prior to FrameworkInitialize()?</title><link>http://forums.asp.net/thread/939021.aspx</link><pubDate>Fri, 27 May 2005 14:46:16 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:939021</guid><dc:creator>bizbiz</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/939021.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=939021</wfw:commentRss><description>Can you give me an example of your global.asax file ?&lt;BR&gt;&lt;BR&gt;I have a page with 4 resources like this :&lt;BR&gt;Register.aspx.resx&lt;BR&gt;Register.aspx.en-CAresx&lt;BR&gt;Register.aspx.fr-CAresx&lt;BR&gt;Register.aspx.fr-FR.resx&lt;BR&gt;&lt;BR&gt;When I put a break point in the Page_load event, the resource manager is load with the Register.aspx.resx.&amp;nbsp; But my currentCulture is en-CA and the uiCulture is en.&amp;nbsp; Anyone can help me ?&lt;BR&gt;&lt;BR&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT size=3&gt;Do you write the keyword new ?&amp;nbsp; Because it give me a warning if I don't do that.&lt;BR&gt;&lt;FONT size=2&gt;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; PreRequestHandlerExecute(&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;Object&lt;/FONT&gt;&lt;FONT size=2&gt; sender, &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;EventArgs&lt;/FONT&gt;&lt;FONT size=2&gt; e)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;// create culture preference cookies if they don't exist yet&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;// otherwise set current thread to value of those cookies&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.Web.&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;HttpCookie&lt;/FONT&gt;&lt;FONT size=2&gt; cookie = Request.Cookies[&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"QuickStartLocalize"&lt;/FONT&gt;&lt;FONT size=2&gt;];&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&lt;/FONT&gt;&lt;FONT size=2&gt; (cookie != &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;null&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;try&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;FONT size=2&gt; currentUICulture = cookie.Values[&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"UICulture"&lt;/FONT&gt;&lt;FONT size=2&gt;];&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;FONT size=2&gt; currentCulture = cookie.Values[&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"Culture"&lt;/FONT&gt;&lt;FONT size=2&gt;];&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt; ( currentUICulture != &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;null &lt;/FONT&gt;&lt;FONT size=2&gt;&amp;amp;&amp;amp; currentUICulture.Length &amp;gt; 0)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.Threading.&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;Thread&lt;/FONT&gt;&lt;FONT size=2&gt;.CurrentThread.CurrentUICulture = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; System.Globalization.&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;CultureInfo&lt;/FONT&gt;&lt;FONT size=2&gt;(currentUICulture);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&lt;/FONT&gt;&lt;FONT size=2&gt; ( currentCulture != &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;null &lt;/FONT&gt;&lt;FONT size=2&gt;&amp;amp;&amp;amp; currentCulture.Length &amp;gt; 0)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.Threading.&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;Thread&lt;/FONT&gt;&lt;FONT size=2&gt;.CurrentThread.CurrentCulture =&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; System.Globalization.&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;CultureInfo&lt;/FONT&gt;&lt;FONT size=2&gt;(currentCulture);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;catch&lt;/FONT&gt;&lt;FONT size=2&gt; (System.&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;Exception&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;}&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;</description></item><item><title>Re: Where to set/change page's culture prior to FrameworkInitialize()?</title><link>http://forums.asp.net/thread/925853.aspx</link><pubDate>Sat, 14 May 2005 10:55:49 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:925853</guid><dc:creator>blackpuppy</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/925853.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=925853</wfw:commentRss><description>&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;Thanks, Fredrik!&lt;br&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;br&gt;
I like the implicit expression because it will save more typing.&lt;br&gt;
&lt;br&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&amp;lt;siteMap &lt;b&gt;enableLocalization="true"&lt;/b&gt; xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" &amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;siteMapNode url="~/Default.aspx" title="Home"&amp;nbsp; description="" &lt;b&gt;resourceKey="Home"&lt;/b&gt;&amp;gt;&lt;br&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;br&gt;
In addition, the web.sitemap.resx and its localized resources need to
be put in App_GlobalResources folder.&amp;nbsp; (I'm using Beta 2.)&lt;br&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Courier New" size="2"&gt;&lt;br&gt;
Zhu Ming&lt;br&gt;
&lt;/font&gt;&lt;/p&gt;

&lt;o:p&gt;&lt;/o:p&gt;</description></item><item><title>Re: Where to set/change page's culture prior to FrameworkInitialize()?</title><link>http://forums.asp.net/thread/924801.aspx</link><pubDate>Fri, 13 May 2005 10:06:45 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:924801</guid><dc:creator>Fredrik N</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/924801.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=924801</wfw:commentRss><description>&lt;A href="http://fredrik.nsquared2.com/viewpost.aspx?PostID=262"&gt;Take a look at this post on my blog.&lt;/A&gt;</description></item><item><title>Re: Where to set/change page's culture prior to FrameworkInitialize()?</title><link>http://forums.asp.net/thread/924798.aspx</link><pubDate>Fri, 13 May 2005 10:01:06 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:924798</guid><dc:creator>blackpuppy</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/924798.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=924798</wfw:commentRss><description>I have another question.&amp;nbsp; Is there a way to localize web.sitemap?&lt;br&gt;
&lt;br&gt;
Thanks!&lt;br&gt;
Zhu Ming&lt;br&gt;</description></item><item><title>Re: Where to set/change page's culture prior to FrameworkInitialize()?</title><link>http://forums.asp.net/thread/923529.aspx</link><pubDate>Thu, 12 May 2005 08:30:09 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:923529</guid><dc:creator>blackpuppy</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/923529.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=923529</wfw:commentRss><description>It works!&amp;nbsp; The only drawback is that the input such as content in
a TextBox will be gone after the redisplay of the same page.&amp;nbsp; The
user has to enter it again.&lt;br&gt;
&lt;br&gt;
Thanks, &lt;span id="_ctl0_PostForm_Reply"&gt;Brock!&lt;br&gt;
Zhu Ming&lt;br&gt;
&lt;br&gt;
&lt;/span&gt;</description></item><item><title>Re: Where to set/change page's culture prior to FrameworkInitialize()?</title><link>http://forums.asp.net/thread/923430.aspx</link><pubDate>Thu, 12 May 2005 04:28:39 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:923430</guid><dc:creator>BrockAllen</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/923430.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=923430</wfw:commentRss><description>&lt;P&gt;Yep and for that last problem I always take the hack approach of Response.Redirect(Request.Path) to make the browser come back in so they see the changes immediaetly.&lt;/P&gt;
&lt;P&gt;-Brock&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item><item><title>Re: Where to set/change page's culture prior to FrameworkInitialize()?</title><link>http://forums.asp.net/thread/923408.aspx</link><pubDate>Thu, 12 May 2005 03:43:12 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:923408</guid><dc:creator>blackpuppy</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/923408.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=923408</wfw:commentRss><description>&lt;span id="_ctl0_PostForm_Reply"&gt;Thanks, Fredrik and &lt;/span&gt;&lt;span id="_ctl0_PostForm_Reply"&gt;Brock!&lt;br&gt;
&lt;br&gt;
I've tried and both methods work!&amp;nbsp; As I need to toggle the culture
for the whole web site instead of individual page, &lt;b&gt;I prefer to do it in
application's &lt;/b&gt;&lt;/span&gt;&lt;span id="PostFlatView"&gt;&lt;b&gt;PreRequestHandlerExeute event handler&lt;/b&gt;.&lt;br&gt;
&lt;br&gt;
Please refer to the help of &lt;/span&gt;&lt;span id="nsrTitle"&gt;HttpApplication Class.&lt;br&gt;
&lt;/span&gt;An application executes events that are handled by modules or user code that is 
defined in the Global.asax file in the following sequence: &lt;br&gt;
&amp;nbsp;&amp;nbsp; &lt;b&gt;1. BeginRequest&lt;/b&gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp; 2. AuthenticateRequest&lt;br&gt;
&amp;nbsp;&amp;nbsp; 3. PostAuthenticateRequest&lt;br&gt;
&amp;nbsp;&amp;nbsp; 4. AuthorizeRequest&lt;br&gt;
&amp;nbsp;&amp;nbsp; 5. PostAuthorizeRequest&lt;br&gt;
&amp;nbsp;&amp;nbsp; 6. ResolveRequestCache&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; An event handler (a page corresponding to the request URL) is created at this point.&lt;br&gt;
&amp;nbsp;&amp;nbsp; 7. PostResolveRequestCache&lt;br&gt;
&amp;nbsp;&amp;nbsp; 8. PostMapRequestHandler&lt;br&gt;
&amp;nbsp;&amp;nbsp; 9. AcquireRequestState&lt;br&gt;
&amp;nbsp; 10. PostAcquireRequestState&lt;br&gt;
&lt;b&gt;&amp;nbsp; 11. PreRequestHandlerExecute&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The event handler is executed.&lt;br&gt;
&amp;nbsp; 12. PostRequestHandlerExecute&lt;br&gt;
&lt;/b&gt;&amp;nbsp; 13. ...&lt;br&gt;
&lt;br&gt;
I tried &lt;b&gt;BeginRequest&lt;/b&gt;, but it does not work.&amp;nbsp; I guess the
reason is that the Page.Request will be created later and will
overwrite the thread culture set in BeginRequest.&lt;br&gt;
Till &lt;b&gt;10. PostAcquireRequestState&lt;/b&gt;, the request is prepared, and only after that can we change the thread culture.&amp;nbsp; Doing that in &lt;b&gt;11. PreRequestHandlerExecute&lt;/b&gt; is exactly &lt;span id="_ctl0_PostForm_Reply"&gt;&lt;/span&gt;&lt;span id="_ctl0_PostForm_Reply"&gt;Brock's approach.&lt;/span&gt; &lt;br&gt;
"&lt;b&gt;The event handler is executed.&lt;/b&gt;" between 11 and 12 is the whole page's processing including any event handlers in the webform's codebehind, I think. &lt;span id="_ctl0_PostForm_Reply"&gt;Fredrik&lt;/span&gt;'s &lt;span id="_ctl0_PostForm_Reply"&gt;approach&lt;/span&gt;, setting the thread culture in &lt;b&gt;InitializeCulture&lt;/b&gt; is exactly here.&lt;br&gt;
&lt;br&gt;
I still have one more problem.&amp;nbsp; The toggle button's event handler
will be executed after the thread culture is set (either in &lt;b&gt;PreRequestHandlerExecute&lt;/b&gt; or in &lt;b&gt;InitializeCulture&lt;/b&gt;).&amp;nbsp;
The result is that after the page reaches the browser the target
culture will be different from the thread culture.&amp;nbsp; While in any
other events, since the target culture is not changed, the target
culture will be the same as the thread culture.&amp;nbsp; This is
a inconsistent behavour.&amp;nbsp; But it is not much a ASP.NET
technical problem.&lt;br&gt;
&lt;br&gt;
Thanks!&lt;br&gt;
Zhu Ming&lt;br&gt;</description></item><item><title>Re: Where to set/change page's culture prior to FrameworkInitialize()?</title><link>http://forums.asp.net/thread/922786.aspx</link><pubDate>Wed, 11 May 2005 16:09:34 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:922786</guid><dc:creator>BrockAllen</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/922786.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=922786</wfw:commentRss><description>&lt;P&gt;Fredrik's approach works, but it's a PITA (IMO) if it's to be done on every page (or in a common base class).&amp;nbsp;We just discussed this the other day, so it's an alternative for you:&lt;/P&gt;
&lt;P&gt;&lt;A HREF="/920819/ShowPost.aspx"&gt;http://forums.asp.net/920819/ShowPost.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;-Brock&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item></channel></rss>