How to convert the text to UPPER case entered in a dynamic text box ? RRS feed

  • Question

  • when you add dynamic text box to your project , and you want the entered text has to be converted to upper case ...

    then below simple solution will help you ..

    TextBox txtMytest = new TextBox();
    txtMytest .Width = Unit.Parse("40");
    txtMytest .ID = "MyTextBox";
    txtMytest .Attributes["onBlur"] = "javascript:{this.value = this.value.toUpperCase(); }";


    Rashmi Ranjan Fatesingh

    • Changed type KareninstructorMVP Sunday, November 5, 2017 12:46 PM this is a question
    • Moved by CoolDadTx Monday, November 6, 2017 3:07 PM ASP.NET related
    Saturday, November 4, 2017 10:26 AM

All replies

  • If this is a WPF app see the following


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Sunday, November 5, 2017 8:58 AM
  • Hello rrfatesingh,

    What type of program you are using? Winform, Wpf, Asp.net or others, please share more information about your program so that we can provide more professional support for you.


    Neil Hu

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, November 6, 2017 9:23 AM
  • Given that you're using JavaScript's onblur and you're using the Unit helper class this looks like an ASP.NET app. Please post questions related to ASP.NET in the ASP.NET forums.

    Michael Taylor http://www.michaeltaylorp3.net

    Monday, November 6, 2017 3:07 PM
  • Hi Neil,

    This is ASP.net application..


    Rashmi Ranjan Fatesingh

    Tuesday, January 2, 2018 8:37 AM