I use to do this thing (Code Behind) ASP.NET using VB.NET:
1) Turn AutoPostBack = True in properties of said Textbox
2) Code for Textbox (Event : TextChanged) Me.TextBox1.Text = Me.TextBox1.Text.ToUpper
3) Observation After entering the string variables in TextBox1, when user leaves TextBox1, AutoPostBack fires the code when Text was changed during "TextChanged" event.