I need some help with a textbox:
The textbox is only allowed to contain letters. how do I do this?
You could do this with javascript to filter out which charaters you accept, but if you can use Asp.net AJAX then you can add a FilteredTextBoxExtender to the textbox and only allow upper case and/or lower case letters.
To add a FilteredTextBoxExtender in Visual Studio 2008 you can do the following:
Check here : How to make Textbox only accept alphabetic characters, there are some different approached to choose from.
Edit: I see on the tags that we are talking asp.net, which the question I mentioned discusses the problem from a WinForms perspective. Might be that you want to do something similar using the onKeyPress event in JavaScript instead.
This article on w3schools.com contains an example code that may do exactly what you are looking for.
Javascript/JQuery is your friend to make the UI only accept letters. However, you must make sure you validate the contents of the textbox on postback otherwise you can have bad data where people have bypassed the javascript.
You can use regular expression validation for this and use following regular expression "^[a-zA-Z]+$"
this is the easiest way to do this.