Parser Error Problem
- by user177140
Hi I have found a problem in Multilingual Asp.Net Web Application
I have Created a Global.asax file and write the code
private void Application_BeginRequest(Object source, EventArgs e)
{
string[] languages = HttpContext.Current.Request.UserLanguages;
if (languages[0].ToLower() != null && languages[0].ToLower()!="")
{
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(languages[0].ToLower());
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture(languages[0].ToLower());
}
}
and define Label Like this
<asp:Label ID="Labeldg" runat="server" Text="<%$ Resources:Resource, Labeldg %>"</asp:Label>
But it through Parser error like:
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: The resource object with key 'LblUsrName_Login' was not found.
Source Error:
</div>
<div class="impcLoginText_Login">
<asp:Label ID="LblUsrName" runat="server" Text="<%$ Resources:PageResource, LblUsrName_Login %>" "></asp:Label>