hi,you can use it in two ways one is using c code using the property of textbox and other is using using regular expression (in this you can use regularexpression validator or js code.)

first take the textbox and put the regularexpressionvalidator control and goto its properties and then choose validationexpression and there you put \d[10] it means it checks for length is 10 or not. done

second is you can use in cs code that is when you are leaving the control means when focus is leaving the control you can fire event and check whether the length is 10 or not or while submitting it's length is 10 or not. suppose submit in click event use the if(Textbox1.Text.Length != 10 ) {messagebox.show("length must be 10");} like this you can use and for leaving the focus it is done in windows application here you can use textchanged event for this use same length property you can choose any way.any way but for client side validation use js code only. means use the regular expression.