views:

60

answers:

2

Possible Duplicate:
Is there any way to determine text direction from CultureInfo in asp.net?

I want to get writing direction of any culture that user select in my application. for example I want to get rtl when my user use fa-IR culture and get ltr when en-US is selected.

Is there a built-in solution for this in .NET?

A: 

I found this article :

http://www.hanselman.com/blog/MakingTheASPNETMobileControlsRenderRTLLanguages.aspx

maybe it can help.

masoud ramezani
+2  A: 

Use the TextInfo.IsRightToLeft property to determine this:

bool isRightToLeft = new CultureInfo("fa-IR").TextInfo.IsRightToLeft;

See MSDN for details.

Morten Mertner