Answered by:
The resource not found error

Question
-
User-409365876 posted
I have a bunch of literals that try to get their info from a resource. I want the page to show Dutch automatically and english by use of a url parameter (?lang=en)
Sub page_load()
paneldrp.Visible = True
panelG.Visible = True
panelA.Visible = False
panelA_sub.Visible = False
PanelVW.Visible = False
'Literal0.Text = Me.GetLocalResourceObject("gesch.Text").ToString() 'uses the currentUICulture
Dim cultureName As String
Dim uiCultureName As String
'Dim culture_object As CultureInfo
Dim subp As String = Request.QueryString("lang")
If subp = "en" Then
cultureName = "en-GB"
uiCultureName = "en-GB"
ElseIf subp = "nl" Then
cultureName = "nl-BE"
uiCultureName = "nl-BE"
Else : cultureName = "nl-BE"
uiCultureName = "nl-BE"
End If
System.Threading.Thread.CurrentThread.CurrentCulture = New CultureInfo(cultureName)
System.Threading.Thread.CurrentThread.CurrentUICulture = New CultureInfo(uiCultureName)
Literal0.Text = System.Threading.Thread.CurrentThread.CurrentCulture.ToString
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(cultureName)
Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture(uiCultureName)
Response.Redirect(Request.Path)
'Server.Transfer(Request.Path)
End Sub
<asp:Literal ID="Literal1" runat="server" Text="<%$ Resources:Voorstelling.aspx.nl-BE, bevord.Text %>"></asp:Literal>
<asp:Literal ID="Literal3" runat="server" meta:resourcekey="natsamw"></asp:Literal>
I use implicit and explicit binding to the resource; with the programmatical binding,
Literal0.Text = Me.GetLocalResourceObject("gesch.Text").ToString()
I keep getting a " System.InvalidOperationException: The resource class for this page was not found. Please check if the resource file exists and try again."
My web.config looks like <globalization uiCulture="auto:nl" culture="auto:nl-BE"/>
In Literal1 I use Resources:Voorstelling.aspx.nl-BE, bevord.Text . Is this correct?
The resources are named "Voorstelling.aspx.nl-BE.resx" and "Voorstelling.aspx.en-GB.resx". There are copies of it in the root and in App_LocalResources. They are also compiled form in ../bin/site.dll, in ../bin/en-GB and in ../bin/nl-BE . Where should I save my resources?
At this moment I want my page to recognize the resources without using InitializeCulture() or any fancy stuff.Is this possible?
This problem has been bugging me for 2 days already. I tried iisreset /stop and /start. Thanks in advance for any pointers...
Thursday, March 25, 2010 9:20 AM
Answers
-
User-1636183269 posted
Even I am also not sure, hotfix can solve this problem but you can ask atleast hot fix to microsoft supprt team
http://support.microsoft.com/contactus/?ws=support
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, March 26, 2010 6:52 AM
All replies
-
User-1636183269 posted
http://support.microsoft.com/kb/933383
Thursday, March 25, 2010 10:13 AM -
User-409365876 posted
Hello Das,
Thank you. I have read the article before. I couldn't download the hotfix, but I did try the workaround many times. It didn't work afterwards. Have I saved my resources in the right place and have I given them correct names?
Thursday, March 25, 2010 10:30 AM -
User-409365876 posted
Hello,
Sorry to bump my own post, but could anyone telle me what might be wrong? Also, the hotfix page you mname doesn't include any download link, while the help page says links to hotfixes appear at the top of the page.
Anyway, I'm using version 3.5, so I don't think the hotfix would help?...
Friday, March 26, 2010 5:29 AM -
User-1636183269 posted
Even I am also not sure, hotfix can solve this problem but you can ask atleast hot fix to microsoft supprt team
http://support.microsoft.com/contactus/?ws=support
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, March 26, 2010 6:52 AM -
User-409365876 posted
Hi everyone,
Where should I save my resources? Should I use the original xml files or the Site.resources.dll version? Should that be in /bin or in /bin/<<language>>-<<culture>>?
Should they be named pagename.aspx.<<language>>-<<culture>>.resx or pagename.<<language>>-<<culture>>.resx . I have found several ways of working in tutorials etc., but they didn't help.
Thanks a lot,
Thomas
Tuesday, March 30, 2010 11:53 AM