You are defining it in every case. You should do it once before switch and
then just refer to it:
System.IFormatProvider format;
switch(vLang){
case "NL":
format = new
System.Globalization.CultureInfo("nl-BE", true);
break;
case "FR":
format = new
System.Globalization.CultureInfo("fr-BE", true);
break;
case "EN":
format = new
System.Globalization.CultureInfo("en-Us", true);
break;
}
Now, it makes sense to make a radio button list for the language selection
and to check wich option is selected in the switch statement.
Eliyahu
"Boonaap" <Bo*****@discussions.microsoft.com> wrote in message
news:01**********************************@microsof t.com...
that the variable 'format' is already known...
which in a switch - case construction seems illogic..
"Curt_C [MVP]" wrote:
"but I get errors".....
What is the error?
--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Boonaap" <Bo*****@discussions.microsoft.com> wrote in message
news:E9**********************************@microsof t.com... Hi,
I have this asp.net application in which the user can choose between
three possible languages. NL - FR - EN
How can I set the System.Globalization.CultureInfo to three different
values, just by clicking a button?
in a pageLoad i have something like this:
switch(vLang){
case "NL":
System.IFormatProvider format = new
System.Globalization.CultureInfo("nl-BE", true);
break;
case "FR":
System.IFormatProvider format = new
System.Globalization.CultureInfo("fr-BE", true);
break;
case "EN":
System.IFormatProvider format = new
System.Globalization.CultureInfo("en-Us", true);
break;
}
but I get errors
anyone a Clue ?
thx