Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

writing right-to-left sentences in ASP.NET labels and text boxes

how can I CORRECTLY display English and non-English (Persian, Farsi language, middle eastern) words in ASP.NET labels or text boxes? it is OK when I type or display only English or only non-English (Farsi) words, but when I type or display a sentence which contains both of them, everything gets out of order, my sentences are misplaced, punctuation symbols are wrongly inserted, in another word it is difficult to understand what is written. When I'm going to use Office Word for writing Persian documents (which may contain English words), first I set paragraph direction as Right-To-Left, is it possible to do something similar in ASP.NET? of course I set following style in my ASPX files and now my texts boxes start writing from right to left but it does nothing for solving the aforementioned problem!

Style="text-align: right"

how can I solve it? thanks

like image 334
Ali_dotNet Avatar asked Oct 28 '11 12:10

Ali_dotNet


1 Answers

You need to use the correct value for the dir attribute - in this case, rtl:

dir="rtl"

This needs to be done in the containing element.

There are also CSS properties you can set, as discussed in this document (thanks @ANeves).

like image 105
Oded Avatar answered Nov 03 '22 00:11

Oded