troubleshooting Question

Not able to read from the correct resx file

Avatar of man_luck
man_luckFlag for India asked on
ASP.NET
3 Comments1 Solution371 ViewsLast Modified:
Hi,
I have two resource files: one having english messages and the other having chinese messages. I set the culture in the code reading the http header using the following code:
            Thread.CurrentThread.CurrentCulture = New CultureInfo(strLocalCulture)
            Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture

The resource file names are myresources.en-US.resx and myresources.zh-TW.resx. I set the language as zh-TW in IE6 from tools > Internet Options > Languages. I debug and see that the correct culture is set i.e.zh-TW. So far so good. Now the problem is that the correct resource file is not read in aspx pages. I use the following code:
<asp:Literal  ID="liComHisInfo" runat ="server" Text ="<%$Resources:myresources,Msg_3105   %>">  </asp:Literal>
 
The application still reads the default en-US resource file in aspx file though in xslt,xml and code behind the correct resource file is read (i.e. zh-TW)
 
I am not sure where exactly I am going wrong..
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros