Click once in dropdownlist for all page in global resources [Resolved]

Posted by Oswaldlily under ASP.NET on 7/29/2011 | Points: 10 | Views : 1829 | Status : [Member] | Replies : 3
i m using global resources to convert to foreign language.
my dropdownlsit is in masterpage and i ve given codebehind below.
thou i have used session each page expecting me to click that foreign language.
In a nutshell,
i has two languahge english and french
when i click first page i ll select french.as a result whole pg ll chang to french.then when i click second page again pageloaded selected dropdownlist value ll be english..again i need to select french to coinvert..
this prob goin on for each page,,,can any1 give me soln?



Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Session("CultureInfo") = Thread.CurrentThread.CurrentUICulture.Name
ddl.SelectedValue = Session("CultureInfo")
End If

Protected Sub ddl_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ddl.SelectedIndexChanged
Session("CultureInfo") = ddl.SelectedValue
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Session("CultureInfo"))
Thread.CurrentThread.CurrentUICulture = New CultureInfo(ddl.SelectedValue)
Thread.CurrentThread.CurrentCulture = New CultureInfo(ddl.SelectedValue)
Server.Transfer(Request.Path)
End Sub




Responses

Posted by: Oswaldlily on: 8/2/2011 [Member] Starter | Points: 25

Up
0
Down

Resolved
i used baseclass and inherit in each page..done

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: SheoNarayan on: 7/29/2011 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Are you using the ASP.NET Localization or your own implementation of creating localized app. Again this is very simple to develop multilingual app in ASP.NET. Follow the steps defined in this article http://www.dotnetfunda.com/articles/article1075-localization-in-aspnet-40-.aspx.

No need to write any code in the .cs file, as soon as the browser language changes the appropriate language resource file is served in that particular language.

In this case, I guess perhaps your implementation is not correct.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Oswaldlily on: 8/1/2011 [Member] Starter | Points: 25

Up
0
Down
No..i m using global resources

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response