Has anyone given any thought on how to programmatically modify/add the dir= attribute to the HTML or BODY tags when the Thread's Culture in ASP.NET is a Right To Left language?
This doesn't work reliablity, as ASP.NET may batch up controls into an HtmlLiteralControl...often, not always, the body (or html) tag can't be found. This depends on how ASP.NET decided to parse the control tree for a particular page. Additionally, there doesn't seem to be anything in CultureInfo that would help me decide what languages are right to left...
If I can reliably get ahold of the HTML control and BODY tags and add this attribute, I'm good.
/* Doesn't work reliably */
HtmlGenericControl bodytag = (HtmlGenericControl)FindControl("body");
Ads by The Lounge