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,957
  • 23
  • 35

1 Answers1

11

use CSS for that

  #idOfyourTextbox{
      text-transform: uppercase;
  }

uppercase that is ;)

Caspar Kleijne
  • 21,552
  • 13
  • 72
  • 102
  • 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