Scott Hanselman

Programmatically modifying DIR=LTR for Right-To-Left Languages in ASP.NET

March 26, '03 Comments [5] Posted in Web Services | ASP.NET
Sponsored By

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";

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

ASP.NET Internationalization, Globalization, and Localization...Whew!

March 24, '03 Comments [2] Posted in Web Services | ASP.NET | Internationalization | TechEd | Speaking | Tools
Sponsored By

I've been out of the office and all over the country of late, up to Redmond 3 times this month and as far from Portland as Raleigh, North Carolina.  Consequently, I've not blogged.  However, I did get an "A" in Physics/Calculus, so thanks for asking. ;)  Turns out my graduation is June 6th, so looks like it will interfere with TechEd.   I'll probably give my presentation and immediately jump on a plane to make it to commencement in time.  (For those of you who don't know, I've managed to squeeze my undergrad into the last eleven years.  Currently I'm Chief Architect at Corillian Corporation, but on Tues, Thurs and Friday nights, I'm just a snot-nosed tyro trying to get through my Physics exams on electromagnetism.  Ah, my life.)

Also, lately I've been up to my ears in ASP.NET, today working on Internationalizing multi-lingual ASP.NET web sites in a performance way, while still using the .NET Resource Manager. 

In the process, I've collected these links on Globalization/Internationalization:

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

How to set a Windows XP or 2000 machine to Auto-Login, or NOT to Auto-Login

March 17, '03 Comments [0] Posted in Web Services
Sponsored By

If you have a Windows XP Professional machine and you want to set it to automatically logon a user, use the Tweak UI Power Toy.

If you have a Windows XP Professional or Windows 2000 machine and you want to set it to STOP automatically logging in a user, clear the saved User ID and Password that is stored in the registry.  See Q234562 for details.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Wrox books goes under...

March 17, '03 Comments [0] Posted in Web Services | XML
Sponsored By

It appears that the parent company of Wrox books has gone under, taking Wrox with it.  The part that really bites is that all authors who are due royalties on existing book sales are out of luck.

 

Here are some links that tell the story.

http://www.theregister.co.uk/content/4/29790.html

http://www.hotfootmail.com/hotfeet/

 

Sigh...They were fairly nice people, and I was happy to have my tiny face on two.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Where's the Platform? Where do YOU think the Platform is?

March 13, '03 Comments [3] Posted in Web Services | XML
Sponsored By

A little confusion around marketing terms today.  As a developer, as devs are wont to do, I usually try to speak the truth, the clear truth, the common sense (from a dev's POV) truth.  But as a Zen-minded fellow, I can see the thinking...or can I?

The term ".NET", and ActiveX before it, is fast becoming the most overloaded operator in Microsoft's marketing message. 

In the beginning, all was .NET.  It was the sun, the moon, the sky.  .NET was a modifer for all the product things....NET myServices, .NET Server Family, .NET Framework, Visual Studio.NET

Then, .NET became more broad and touchy feeling...".NET is software that connects people, systems, and devices."  This is inline with the recent IBM commercials that have transformed the image of Big Blue in peoples' minds from old and stogy to the nimble competitor of Microsoft.  Microsoft countered with "1° of separation" adds that sell the idea of .NET software.

Then, pundits broke it down to the basics...".NET is Microsoft's implementation of Web Services"

So, at this point, it sounds like .NET is a platform, right?  Well, no, not according to Microsoft.  The Windows .NET Framework is a core part of Windows, as core as the Win32 API.  .NET is NOT a Platform - Windows is the Platform.  .NET provides the runtime.  Windows provices the services. 

So using this new information I decided to attempt to use ".NET" in a sentence.

".NET and Visual Studio is how you create WS-I Compliant XML Web Services on the Windows Platform."

This makes me very happy, since learning how to use a new word in a sentence marks the beginnings of fluency.


.NET Zen Koan
"People think it is hard to see the .NET, but in reality it is neither difficult nor easy.  It is a matter of responding to C# and VB.NET while remaining detached from C# and VB.NET, living in the midst of passions yet being detached from passions, seeing without seeing, hearing without hearing, acting without acting, seeking without seeking. "


Unsafe Zen Koan
"Scott showed out his unsafe code and said, "If you call this unsafe code, you oppose its reality. If you do not call it unsafe code, you ignore the fact. Now what do you wish to call this?"


 Languages Zen Koan
"One day Fred was working with .NET. He overheard a programmer say to his superior, "Give me the best programming language you have." "Every language in .NET is the best," replied the butcher. "You can not find any language in .NET that is not the best." At these words, Fred was enlightened. "


 Managed Zen Koan
"One day as Sam was writing Managed C++, the Buddha called to him, "Sam, Sam, why do you not enter the runtime and write in C#?" Sam replied, "I do not see myself as outside. Why enter?"

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.