I didn't realize ASP.Net tag! I'm sorry!:(
Limiting maximum length of string is simple, go to Properties Window and look for MaxLength property
myTextBox.MaxLength = 10;
At most of times I check my input on KeyPress event.
myTextBox.KeyPress += delegate(object sender, KeyPressEventArgs e)
e.Handled = true;