Convert Lowercase to Uppercase in TextBox control in ASP.NET

How to us ToUpper() and ToLower() Function in TextBox in ASP.Net

- In this ASP.Net Tutorials we will learn ToUpper() Function and ToLower() Function in ASP.Net C#.

ToUpper() – The ToUpper() Function in ASP.Net used to convert Lowercase alphabet value to Uppercase alphabet value.

- ToLower() – ToLower() Function in ASP.Net used to convert Uppercase alphabet value to Lowercase alphabet value.

write below code in Body tag:-

<body>
    <form id=”form1″ runat=”server”>
  <table>
                        <tr>
                            <td style=”width: 100px; text-align: right”>
                                Enter Value :</td>
                            <td style=”width: 100px”>
                                <asp:TextBox ID=”txtvalue” runat=”server”></asp:TextBox></td>
                            <td style=”width: 100px”>
                            </td>
                        </tr>
                        <tr>
                            <td style=”width: 100px”>
                            </td>
                            <td colspan=”2″ style=”text-align: left”>
                                <asp:Button ID=”btnsubmit” runat=”server” OnClick=”btnsubmit_Click” Text=”ToUpper” />
                                <asp:Button ID=”btnlower” runat=”server” OnClick=”btnlower_Click” Text=”ToLower” /></td>
                        </tr>
                        <tr>
                            <td style=”width: 100px; text-align: right”>
                                Answer :</td>
                            <td colspan=”2″ style=”text-align: left”>
                                <asp:TextBox ID=”txtanswer” runat=”server”></asp:TextBox></td>
                        </tr>
                    </table>
</form>
</body>

Write below code in Button Click Event to convert Uppercase:-

protected void btnsubmit_Click(object sender, EventArgs e)
    {
   txtanswer.Text = txtvalue.Text.ToUpper();
}

TextBox Control ToUpper() Funcation in ASP.Net

TextBox Control ToUpper() Funcation in ASP.Net

Write below code in Botton click event for convert Lowecase value from Uppercase:-

protected void btnlower_Click(object sender, EventArgs e)
    {
        txtanswer.Text = txtvalue.Text.ToLower();

    }

TextBox control ToLower() in ASP.Net

TextBox control ToLower() in ASP.Net

In above post we leant to convert Lowecase value to Uppercase Value use of ToUpper() Funcation, and convert Uppercase value to Lowercase using the ToLower() Function in ASP.Net C#.

- I hope you enjoy this ASP.Net TextBox Example post.

Leave a Reply

Your email address will not be published. Required fields are marked *

9 + 7 =


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">