How can I force input to uppercase in an ASP.NET textbox?
Why not use a combination of the CSS and backend? Use:
style='text-transform:uppercase'
on the TextBox, and in your codebehind use:
Textbox.Value.ToUpper();
You can also easily change your regex on the validator to use lowercase and uppercase letters. That's probably the easier solution than forcing uppercase on them.
Use a CSS style on the text box. Your CSS should be something like this:
.uppercase
{
text-transform: uppercase;
}
<asp:TextBox ID="TextBox1" runat="server" Text="" CssClass="uppercase"></asp:TextBox>;