G
Guest
Hi,
I am running into a problem of mixing UICulture = auto and allowing users to
select culture using a dropdown list.
I am detecting a querystring, "setlang", and when found, setting the
CurrentUICulture to what's specified in the querystring. Since I want to
allow UICulture auto detecting, I add UICulture = "auto" to page directive on
each page.
Now, here is the problem: I don't know on what event (page or application) I
should set the CurrentUICulture based on the querystring, "setlang".
Since the UICulture = "auto", I cannot utilize any of the application events
to set CurrentUICulture. I could use PostAcquireRequestState if UICulture is
not auto on in page directive.
I cannot use page event effectively either. I tried to set CurrentUICulture
based on querystring in Page.PreInit. It seems that if I programmatically set
control's text to a resource string (textbox1.text =
resources.language.astring) everything works fine, but if I use explicit
binding declaratively on the control (<%$ Resources: language, astring%>), it
ignores the CurrentUICulture set in Page.PreInit and displays the string from
the culture the page auto detects. Not being able to bind declaratively is a
produtivity killer and therefore not acceptable.
Can anyone shed some light on how I can accomplish this?
I will repeat what I want to accomplish:
1) UICulture = "auto" on page directive (or can I set it somewhere else?)
2) user selectable cultures
3) being able to bind resources to control declaratively (<%$ Resources:
language, astring%>)
I am running into a problem of mixing UICulture = auto and allowing users to
select culture using a dropdown list.
I am detecting a querystring, "setlang", and when found, setting the
CurrentUICulture to what's specified in the querystring. Since I want to
allow UICulture auto detecting, I add UICulture = "auto" to page directive on
each page.
Now, here is the problem: I don't know on what event (page or application) I
should set the CurrentUICulture based on the querystring, "setlang".
Since the UICulture = "auto", I cannot utilize any of the application events
to set CurrentUICulture. I could use PostAcquireRequestState if UICulture is
not auto on in page directive.
I cannot use page event effectively either. I tried to set CurrentUICulture
based on querystring in Page.PreInit. It seems that if I programmatically set
control's text to a resource string (textbox1.text =
resources.language.astring) everything works fine, but if I use explicit
binding declaratively on the control (<%$ Resources: language, astring%>), it
ignores the CurrentUICulture set in Page.PreInit and displays the string from
the culture the page auto detects. Not being able to bind declaratively is a
produtivity killer and therefore not acceptable.
Can anyone shed some light on how I can accomplish this?
I will repeat what I want to accomplish:
1) UICulture = "auto" on page directive (or can I set it somewhere else?)
2) user selectable cultures
3) being able to bind resources to control declaratively (<%$ Resources:
language, astring%>)