Last post Oct 19, 2007 03:48 AM by vivek_iit
Oct 18, 2007 04:38 PM|Fleurya|LINK
I've got a multi-culture website using asp.net 2.0 localization. I have a Global Resource that I created that contain various Email Subjects and Body that get set out using the Membership Providers. I've been getting some complaints that some emails are
sent out in the wrong language...
The way I have it set up is, the user language is set inside a cookie which is read in the Global's Application_BeginRequest method, that sets the CurrentThread's Culture and UICulture. Then in the SendingMail methods of both the CreateUserWizard and ForgotPassword
I create an email by using the Auto-Generated Strongly Typed class for my Email Global Resource.
I took a look at this class and noticed that it uses a shared Field for both the resourceCulture (cultureInfo) and the resourceMan (ResourceManager)
Could this mean that each thread is using the same shared fields and causing a request that is in english to be calling the french resx values ?
Should I be using the GetGlobalResource instead or setting the Resources.Emails.Culture property before calling my resources ?
Any help would be appreciated
Oct 19, 2007 03:48 AM|vivek_iit|LINK
Using a global shared (static in C#) is not a good idea as it would be shared across different requests. You should use a cookie or a Session object for this.
Hope this helps,