// The following namespaces were added
using System.Globalization;
using System.Threading;
public partial class _Default : System.Web.UI.Page
{
protected override void InitializeCulture()
{
base.InitializeCulture();
Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-CA");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-CA");
}
protected void Page_Load(object sender, EventArgs e)
{
}
}
I don't know what else I missed here, but I don't see any thing on my web page, when I try to run it.
Please advise.
Thank you very much!
Disregard, What I just said. It seems to work, not sure though!
// The following namespaces were added
using System.Globalization;
using System.Threading;
public partial class _Default : System.Web.UI.Page
{
protected override void InitializeCulture()
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-CA");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-CA");
base.InitializeCulture();
}
protected void Page_Load(object sender, EventArgs e)
{
}
}
Ashutosh Pathak
Blog: http://catchcode.blogspot.com Please mark it as answer if it helps, as clicking on the button can save time of others :)
MCP,MCAD,MCSD,MCTS
Actually, I have deployed this website on the Server.
I have mapped the project folder(shared folder) to my computer.
When I open the website in Visual Studio from the shared folder and run the website, it works fine.
But, when I browse deployed website through URL directly, it does not work.
I get the below error message:
Server Error in '/' Application.
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 'LangueLink' was not found.
Source Error:
Line 40: <td>
Line 41: <%--<a href="#" id="lnkLang" onclick="ChangeLang()" runat="server">fr</a>--%>
Line 42: <asp:linkbutton id="lbLang" runat ="server" onclick="lbLang_Click" Text="<%$ Resources:GlobalizationDemo, LangueLink %>" ></asp:linkbutton> Line 43: </td>
Line 44: </tr>
krishna.bb
Member
129 Points
113 Posts
Globalization/localization help needed
Aug 28, 2012 06:49 PM|LINK
Hi Friends,
I am new (zero) to globalization/localization concept.
I need your help.
I did go through a lot of examples, but I could not make my web application work :(
1) Creating Resource files (French)
File name: LangueResource.fr-CA.resx
Key & Value: WelcomeMessage & Bonjour
2) Binding control with the ResouceKey in Design
<form id="form1" runat="server"> <table> <tr> <td> <asp:label id="lbl" runat="server" Text="<%$ Resources:LangueResource, WelcomeMessage%"> </asp:label> </td> </tr> </table> </form>3) Setting the Culture & UICulture in Code behind
// The following namespaces were added using System.Globalization; using System.Threading; public partial class _Default : System.Web.UI.Page { protected override void InitializeCulture() { base.InitializeCulture(); Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-CA"); Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-CA"); } protected void Page_Load(object sender, EventArgs e) { } }I don't know what else I missed here, but I don't see any thing on my web page, when I try to run it.
Please advise.
Thank you very much!
Disregard, What I just said. It seems to work, not sure though!
Krishna
AccuWebHosti...
Contributor
2212 Points
401 Posts
Re: Globalization/localization help needed
Aug 30, 2012 04:21 PM|LINK
See articles/Examples at following URL if that can help you :
Set the Culture
Globalization and Localization in .NET
Top Windows VPS Provider
Ashutosh Pat...
Contributor
5737 Points
1105 Posts
Re: Globalization/localization help needed
Aug 31, 2012 06:16 PM|LINK
change your code to below:
// The following namespaces were added using System.Globalization; using System.Threading; public partial class _Default : System.Web.UI.Page { protected override void InitializeCulture() { Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-CA"); Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-CA"); base.InitializeCulture(); } protected void Page_Load(object sender, EventArgs e) { } }Blog: http://catchcode.blogspot.com
Please mark it as answer if it helps, as clicking on the button can save time of others :)
MCP,MCAD,MCSD,MCTS
krishna.bb
Member
129 Points
113 Posts
Re: Globalization/localization help needed
Oct 19, 2012 08:27 PM|LINK
Actually, I have deployed this website on the Server.
I have mapped the project folder(shared folder) to my computer.
When I open the website in Visual Studio from the shared folder and run the website, it works fine.
But, when I browse deployed website through URL directly, it does not work.
I get the below error message:
Server Error in '/' Application.
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 'LangueLink' was not found.
Source Error:
Line 40: <td> Line 41: <%--<a href="#" id="lnkLang" onclick="ChangeLang()" runat="server">fr</a>--%> Line 42: <asp:linkbutton id="lbLang" runat ="server" onclick="lbLang_Click" Text="<%$ Resources:GlobalizationDemo, LangueLink %>" ></asp:linkbutton> Line 43: </td> Line 44: </tr>Krishna