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");
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. I am a failed stand-up comic, a cornrower, and a book author.
Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.