4

I need to DISPLAY the text in an asp textbox as upper case, regardless of whether the users caps lock is on or not – is there some property or method I can use? I am converting the text using the .ToUpper method on submitting to the database anyway, but I have been asked to also DISPLAY it in upper case before that when first being typed.

Any help would be much appreciated.

Abhi.

Abhishek Jain
  • 2,937
  • 21
  • 33

1 Answers1

11

use CSS for that

  #idOfyourTextbox{
      text-transform: uppercase;
  }

uppercase that is ;)

Caspar Kleijne
  • 20,852
  • 11
  • 68
  • 100
  • if he uses server control it is better to create class in css :) – Danil Sep 27 '10 at 09:59
  • 2
    no it is not: css inside the server control creates inline css, that is bad practice ;) CSS shoul always be in a stylesheet, referenced by class, Id or elementname in the HTML. – Caspar Kleijne Sep 27 '10 at 10:03