buntykawale
buntykawale

Reputation: 191

Setting the text direction for a Label in ASP.NET

I'm working on a multi-lingual application which requires me to change the text direction (either ltr or rtl) dynamically according to the user language.

I used a label for this. I assigned it a css class which would set the direction but its not working.

I also added a style to its CssStyleCollection list but its not working too.

Where am I doing it wrong? What are the ways in which it can be achieved?

Upvotes: 0

Views: 2404

Answers (2)

Dan Herbert
Dan Herbert

Reputation: 103377

If you post the CSS you're using, I may be able to identify anything that could be wrong with it. Otherwise, try this in your label control:

Label myLabel = new Label();
myLabel.Attributes.Add("dir", "rtl");

Of course, you may want to set the direction at a top-level tag such as the <body /> so it affects the entire page and not just one label.

Upvotes: 2

Sean Molam
Sean Molam

Reputation: 638

There is a great resources on MSDN that should be helpful.

Upvotes: 4

Related Questions