The views expressed on this weblog are mine alone and do not necessarily reflect the views of my employer.
 Thursday, March 27, 2003
Essential ASP.NET with Examples in C#

Fritz hits one out of the park [Don Box]

It's twue, it's twue...this book does kick extreme ass.  So often you buy a .NET book and look at only chapters 19 and 20 and the rest is fodder.  This book is NOT like that.

As you look at the Table of Contents, you notice right away this book is not structured like a typical ASP.NET book (as Fritz is not structured like a typical programmer, this is to be expected). 

It begins with Architecture (a nice first chapter) and chapter 4 gets right into the HTTP Pipeline.  The Table of Contents reads like a directory of What's Misunderstood in ASP.NET - which is exactly how it should.  It is now carried under my arm with pride, I recommend you pick up a copy.


Updated Link to this post 3:38:05 PM  #    comment []  trackback []
Programmatically modifying DIR=LTR for Right-To-Left Languages in ASP.NET

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");
if (Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName == "ar")
   bodytag.Attributes["dir"] = "rtl";
else
   bodytag.Attributes["dir"] = "rtl";


Updated Link to this post 12:24:16 AM  #    comment []  trackback []