Ramblings & Controls from a .NET Addicted Freak!

Kevin Gearing's Blog

New Control - CasedTextBox - Sets TextBox Character Case

Unlike Windows Forms.NET, ASP.NET textbox controls seem to be missing the 'Character Casing' property which allows you to define the case of characters entered within a textbox.

Whilst it's fairly easy to replicate by hooking up some JavaScript to the 'onblur event', e.g.

txtEMailAddress.Attributes.Add("onblur", "this.value = this.value.toLowerCase();");

it becomes a bit of a pain having to enter this on every page. So, below is a simple ASP.NET control that basically does it for you. It simply inherits from the standard TextBox class and adds a new 'Character Casing' property allowing you to set the character case to one of three options:


  • CharacterCasing property to set the case to upper (all characters uppercase), upper first (only the first character uppercase) or lower (all characters lowercase).
  • Full Visual Studio .NET designer integration.


Simply download, add to your toolbox, drag 'n' drop to your page and set the property using the property grid.

Licensing & Download:

Free for both personal and commercial use, however please consider donating!

You may also redistribute the control royalty free, providing that you don't charge for it. Also, if you intend to distribute the control as part of an application which is publicly available it would be nice to know, although this isn't a requirement.

To download, please visit the 'Downloads' area.


Help & Support:

Please post in the forum.


Revision History:

Updated 05/06/2007 (v2.0.0):

Click here for details.

Updated 29/10/2004 (v1.0.0):

  • Namespace changed from dotNetFreak.WebControls.UI to dotNetFreak.WebControls.
  • Much improved designer integration.
  • Property values are now stored in ViewState.
  • OnPreRender bug fixed.
  • Assembly is now signed with a Strong Name.
Published Jul 04 2004, 03:05 PM by dotNetFreak
Filed under: ,


No Comments
Copyright ©2004-2007 Kevin Gearing. All Rights Reserved.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems