Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6162635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:41:14+00:00 2026-05-23T21:41:14+00:00

I want to create a user control [textbox] which convert all the text in

  • 0

I want to create a user control [textbox] which convert all the text in the Upper case.
In normal web page, I can do it via

<asp:TextBox ID="TextBox1" runat="server">
    </asp:TextBox>

    <style type="text/css">
    #TextBox1
       { 
          text-transform: uppercase; 
       } 
</style>

I am not aware how to convert them in user control and how can I create my own textbox control which has this feature in build. So that I can drag-drop them from my toolbox and can use it.

Any help?

Edit

It would be just like, I want to give one more property to the textbox [Let say: Uppercase=”True” or Uppercase=”False”] which will decide whether the textbox character will be uppercase or not.

Edit 1

enter image description here

Edit 2

   using System;
using System.Collections.Generic;
using System.Text;
using System.Web;

namespace UppercaseBox
{
    public class UppercaseTextBox : System.Web.UI.WebControls.TextBox
    {
        public extern Boolean Uppercase 
        { get; 
          set;
        }
        public override string Text
        {
            get
            {
                return Uppercase && !string.IsNullOrEmpty(base.Text) ? base.Text.ToUpper() : base.Text;
            }
            set
            {
                base.Text = Uppercase && !string.IsNullOrEmpty(value) ? value.ToUpper() : value; ;
            }
        }
    }
}

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:41:15+00:00Added an answer on May 23, 2026 at 9:41 pm

    The simpler way i see is that you could create a custom control that inherits from TextBox and override the Text property so that it changes the text to uppercase.

    Public Class UppertextBox
            Inherits Web.UI.WebControls.TextBox
    
            Public Overrides Property Text As String
                Get
                    Return MyBase.Text.ToUpper
                End Get
                Set(ByVal value As String)
                    MyBase.Text = value.ToUpper ' no check for null, add it if necessary
                End Set
            End Property
    
        End Class
    

    The uppercasing could depend on a property of your control, to allow you to customize the textbox in the page using it.

    Public Class UppertextBox
            Inherits Web.UI.WebControls.TextBox
    
            Public Property Uppercase As Boolean
    
            Public Overrides Property Text As String
                Get
                    If Uppercase AndAlso Not String.IsNullOrEmpty(MyBase.Text) Then
                        Return MyBase.Text.ToUpper
                    Else
                        Return MyBase.Text
                    End If
                End Get
                Set(ByVal value As String)
                    If Uppercase AndAlso Not String.IsNullOrEmpty(value) Then
                        MyBase.Text = value.ToUpper
                    Else
                        MyBase.Text = value
                    End If
    
                End Set
            End Property
    
        End Class
    

    Your inherited control could also set its style to uppercase but i’d recommend alternatively using themes if you don’t want to bother setting the style at each use

    EDIT

    C# Version would look like

    public class UppercaseTextBox : System.Web.UI.WebControls.TextBox
        {
            public Boolean Uppercase { get; set; }
            public override string Text
            {
                get
                {
                    return Uppercase && !string.IsNullOrEmpty(base.Text) ? base.Text.ToUpper() : base.Text;
                }
                set
                {
                    base.Text = Uppercase && !string.IsNullOrEmpty(value) ? value.ToUpper() : value;
                }
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a user control, which can be bound to some data
I want to create a Web app which would allow the user to upload
I want to create a web page where a registered user picks a number
ASP.Net 3.5 I want to create a user control that contains the ListView and
I have a user control and I want to create a property of type
I am trying to create a winForms user control. But I want would like
I have a stored procedure in which i want to create a user defined
I have created a web user control (MemberDetails.ascx) which is loaded dynamically on a
I have created a user control which basically consists of 3 text boxes. I
I want to create in C# Visual Studio 2010 my user control from standard

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.