It is easy to develop multi language supported web site using ASP.NET . Just follw that step by step.
1.Take a new web site
2.Add “App_GlobalResources” from ASP.NET folders
3.Take a *.resx file (Strings.resx)
4.Enter Name and values
5.Make different *.resx file for different languages and name like that Strings.en-US.resx (for US english), Strings.fr-FR.resx (for French). Make as many language file you needed
6.Now time for calling and using language from web page
You website Solution Explorer will look like that
Default.aspx file will look like that
<asp:Label ID=”lblName” runat=”server” Text=”Label”></asp:Label>
<asp:Label ID=”lblDesc” runat=”server” Text=”Label”></asp:Label>
<asp:Label ID=”lblComments” runat=”server” Text=”Label”></asp:Label>
<asp:LinkButton ID=”lnkEnglish” runat=”server” OnClick=”lnkEnglish_Click”>English</asp:LinkButton>
<asp:LinkButton ID=”lnkFrench” runat=”server” OnClick=”lnkFrench_Click”>French</asp:LinkButton>
Codes of Default.aspx.cs
private ResourceManager rm;
protected void Page_Load(object sender, EventArgs e)
{
CultureInfo ci;
if (!IsPostBack)
{
Thread.CurrentThread.CurrentCulture = new CultureInfo(”en-US”);
rm = new ResourceManager(”Resources.Strings”, Assembly.Load(”App_GlobalResources”));
ci = Thread.CurrentThread.CurrentCulture;LoadData(ci);
}
else
{
rm = new ResourceManager(”Resources.Strings”,Assembly.Load(”App_GlobalResources”));
ci = Thread.CurrentThread.CurrentCulture;LoadData(ci);
}
}
protected void lnkEnglish_Click(object sender, EventArgs e)
{
Thread.CurrentThread.CurrentCulture = new CultureInfo(”en-US”);
LoadData(Thread.CurrentThread.CurrentCulture);
}
protected void lnkFrench_Click(object sender, EventArgs e)
{
Thread.CurrentThread.CurrentCulture = new CultureInfo(”fr-FR”);
LoadData(Thread.CurrentThread.CurrentCulture);
}
public void LoadData(CultureInfo ci)
{
lblName.Text = rm.GetString(”EventName”, ci);
lblDesc.Text = rm.GetString(”EventDescription”, ci);
lblComments.Text = rm.GetString(”EventComments”,ci);
}



hi ashraf see my site for Multi language supported web site in ASP.NET
i need code Multi language supported web site in ASP.NET.
thanks.
Fast and Easy )
thanx
Thank you for you short but very clear article!
My question: the links to change a language are in my MasterPage. How do I force that when clicked, also the correct functions in de current Page are called for the translation?
Hello Jan,
Thanks for your comment.
Sorry i am not understanding your question completely. Will you please ask me in details about what the question is?
hi,
i need to change my whole website with other language seleced in the dropdown using .net application can you send me the sample application code in my mail.
i have tried your code but i don’t know what i need to give in resx file as name and value
page load it is giving me an error
thanks & regards
hemalatha
My fellow on Facebook shared this link with me and I’m not dissapointed at all that I came to your blog.
Not that I’m totally impressed, but this is a lot more than I expected when I stumpled upon a link on Delicious telling that the info is awesome. Thanks.
I need to create two different aspx page and the content of those pages in different native languages. How can i do this in .net….
Thanks in advance….
A fantastic read….very literate and informative. Many thanks….what theme is this you are using and also, where is your RSS button ?
hello thanks for your comment.
my site theme name is MistyLook and feed URL is at the top of the page http://ashrafur.wordpress.com/feed/
Thanks
hello mr.ashraf,i got an idea of developing a multilanguage websit but in dat website how to use the grid view control n the fields of the gridview control should work with multilanguage
Hi, pls guid to add new language dyanmicaly in asp.net
Hi, Pls guid to add new language dyanmicaly into my asp.net application.
Advance. Thanks