Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>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. </p> <pre><code>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 </code></pre> <p>The uppercasing could depend on a property of your control, to allow you to customize the textbox in the page using it.</p> <pre><code>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 </code></pre> <p>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</p> <p><strong>EDIT</strong></p> <p>C# Version would look like</p> <pre><code>public class UppercaseTextBox : System.Web.UI.WebControls.TextBox { public Boolean Uppercase { get; set; } public override string Text { get { return Uppercase &amp;&amp; !string.IsNullOrEmpty(base.Text) ? base.Text.ToUpper() : base.Text; } set { base.Text = Uppercase &amp;&amp; !string.IsNullOrEmpty(value) ? value.ToUpper() : value; } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload