Category Archives: TextBox Example

TextBox Remaining Character Counter using JavaScript in ASP.Net

In this asp.net post i will show you how to count the remaining character in textbox control using javaScript in asp.net.

First design asp.net web forms with one textbox control and a Label Control.

Here, we can see the remaining character while we write text in textbox control, we use javaScript for count the remaining character.

Here, we call the javascript function on onkeyup textbox events.

First set the textbox MaxLength=15 and call javascript function on onkeyup=”cnt()”.

below is the design of asp.net web forms:

 

Here is the JavaScript function for count remaining character:

The output of count remaining character in textbox using javascript :

TextBox Remaining Character Counter using JavaScript in ASP.Net

TextBox Remaining Character Counter using JavaScript in ASP.Net

– above screen shows the total length of textbox is 15. when we write text into textbox the count automatically decreases according to length of textbox text.

TextBox Remaining Character Counter using JavaScript in ASP.Net

TextBox Remaining Character Counter using JavaScript in ASP.Net

– in above forms we write “meera” the 5 character then the count shows the 10 character is remaining in textbox control.

TextBox Remaining Character Counter using JavaScript in ASP.Net

TextBox Remaining Character Counter using JavaScript in ASP.Net

How to change TextBox Border Width, Style, Color in ASP.NET

– Hi, In this ASP.NET Example we will learn how to  change TextBox Control Border Style, Border width and border color in programmatically in ASP.NET.

– First the Design the webfor with one TextBox along with the 3 button control in ASP.NET.

For Design, write the below code in Body tag:

<table>
<tr>
<td style=”width: 100px; text-align: right”>
Enter Value :</td>
<td style=”width: 100px”>
<asp:TextBox ID=”TextBox1″ runat=”server” CssClass=”txt”></asp:TextBox></td>
<td style=”width: 100px”>
</td>
</tr>
<tr>
<td colspan=”3″>
&nbsp;<asp:Button ID=”Button1″ runat=”server” OnClick=”Button1_Click” Text=”Border width” />
<asp:Button ID=”Button2″ runat=”server” OnClick=”Button2_Click” Text=”Border Style” />
<asp:Button ID=”Button3″ runat=”server” OnClick=”Button3_Click” Text=”Border color” /></td>
</tr>
</table>

The design layout look like below screen :

How to change Textbox borderwith, style and color in ASP.NET

How to change Textbox borderwith, style and color in ASP.NET

Now we have Three Button control one for Change the TextBox width, second for Change the Textbox Style and last one is for Change the Textbox Border color.

Fist we change the Textbox Border color programmatically in ASP.NET C#.

For change the Textbox bordercolor write below code in Button Click event:

protected void Button3_Click(object sender, EventArgs e)
{
TextBox1.BorderColor = System.Drawing.Color.Red;
}

The ASP.NET Textbox border color change Result is:

Change Textbox bordercolor in ASP.NET - ASP.NET Textbox Example

Change Textbox bordercolor in ASP.NET – ASP.NET Textbox Example

Now we will learn to change the border width of Textbox control in ASP.NET.

write below code for change the Textbox border width in ASP.NET

protected void Button1_Click(object sender, EventArgs e)
{
TextBox1.BorderWidth = 7;
}

The output of changed Textbox border width is below:

Change Textbox border width in ASP.NET - ASP.NET Textbox Example

Change Textbox border width in ASP.NET – ASP.NET Textbox Example

– Now last change the Textbox Style programatically in ASP.NET C#.

– write this code for change the Textbox border style in Button Click Event.

 protected void Button2_Click(object sender, EventArgs e)
{
TextBox1.BorderStyle = BorderStyle.Double;
}

The ASP.NET Textbox Border Style changed output is:

change Textbox BorderStyle in ASP.NET - ASP.NET Textbox Example

change Textbox BorderStyle in ASP.NET – ASP.NET Textbox Example

– I hope you enjoyed to learn this ASP.NET Textbox Example change Border Style, Textbox Border width, Textbox Bordercolor Programmatically in ASP.NET.

 

How to use css in TextBox – ASP.NET TextBox Example

– Css is used to apply the style on asp.net control.

STEP 1 :- Create New StyleSheet File in ASP.Net.

How to use css StyleSheet in ASP.NET - ASP.NET Textbox Exmaple

How to use css StyleSheet in ASP.NET – ASP.NET Textbox Exmaple

STEP 2 :- write the below style code in Stylesheet file.

.txt
{
background-color:Yellow;
font-size:large;
font-weight:bold;
}

STEP 3 : After creating Stylesheet file apply that style on webfom by writing below code in HEAD tag:

write below code in head tag:

<head runat=”server”>
<link rel =”Stylesheet” href=”styleSheet.css” />
</head>

Now you can set the CssClass Property of TextBox control CssClass = txt.

Create StyleSheet in ASP.NET - ASP.NET TextBox Example

Create StyleSheet in ASP.NET – ASP.NET TextBox Example

– Now you can see the output like :

Create Stylesheet in ASP.Net - ASP.NET Textbox Example

Create Stylesheet in ASP.Net – ASP.NET Textbox Example

– Css Style sheet we can apply selected control in ASP.Net while the Them will apply whole webform for all control.

– Hope you enjoyed this ASP.Net TextBox Example Css Tutorials.

How to use Theme and Skin in Textbox control in ASP.NET

Hi Here we learn to use Theme and skin in ASP.Net TextBox Example.

Theme is used to design the ASP.NET serer control.
First create the Theme for each control.

Example: – IF we create a theme for TextBox control, apply that theme on webform so all the TextBot control affected that theme on same webform.

STEP 1 :-

Create a Theme, Just right click on the Project title–> Add ASP.Net Folder –>Theme

How to use Theme and skin in ASP.Net - ASP.Net Textbox Example

How to use Theme and skin in ASP.Net – ASP.Net Textbox Example

STEP 2 :- After Adding Theme Folder Add New Item in Theme Folder –> Skin File.

How to use Theme and skin in ASP.Net - ASP.Net Textbox Example

How to use Theme and skin in ASP.Net – ASP.Net Textbox Example

STEP 3 :- Add the Skin File.
– Write Below code in Skin File for TextBox Style

<asp:TextBox runat=”server” BackColor=”#FFFFC0″ Font-Bold=”True” ForeColor=”Red”></asp:TextBox>

How to use Theme and skin in ASP.Net - ASP.Net Textbox Example

How to use Theme and skin in ASP.Net – ASP.Net Textbox Example

STEP 4 : Now apply the Theme file on all webform by writing below line on HTML coding:

<%@ Page Language=”C#” AutoEventWireup=”true” CodeFile=”txttheme.aspx.cs” Inherits=”txttheme” Theme=”Theme1″ %>

– In below figure we can see the output of Theme in .net
– all the Textbox style change on runtime.

How to use Theme and skin in ASP.Net - ASP.Net Textbox Example

How to use Theme and skin in ASP.Net – ASP.Net Textbox Example

In above ASP.NET Textbox Example we learn to apply theme and skin File in ASP.NET C#.

– Hope you enjoy this ASP.Net Tutorials.

How to Change TextBox Control Font and Style in ASP.NET

Change TextBox control Font and Style Programmatically in ASP.Net

In this post we are going to learn how to change TextBox Control Font Size,  TextBox Color, Background all style of Textbox control in ASP.Net TextBox Example.

First, Design the Page with One TextBox control along with 2 Button Control.

Write below code in Body tag :

 <table style=”width: 376px”>
<tr>
<td style=”width: 100px; text-align: right”>
Enter Value:&nbsp;
</td>
<td colspan=”2″ style=”text-align: left”>
<asp:TextBox ID=”TextBox1″ runat=”server”></asp:TextBox></td>
</tr>
<tr>
<td colspan=”3″ style=”height: 26px”>
&nbsp;<asp:Button ID=”Button1″ runat=”server” OnClick=”Button1_Click” Text=”Style1″
Width=”80px” />
<asp:Button ID=”Button2″ runat=”server” OnClick=”Button2_Click” Text=”Style2″ Width=”80px” /></td>
</tr>
</table>

The Design form look like below screen.

Change TextBoxt Font Style in ASP.NET - ASP.NET TextBox Example

Change TextBoxt Font Style in ASP.NET – ASP.NET TextBox Example

– Now write the Below code in Style1 Button Click Event:

 protected void Button1_Click(object sender, EventArgs e)
{
TextBox1.ForeColor = System.Drawing.Color.Red;
TextBox1.Font.Size = 17;
TextBox1.Font.Bold = true;
TextBox1.BackColor = System.Drawing.Color.Yellow;
}

The ASP.NET TextBox Example Output is :

Change TextBox Font Style in ASP.Net - ASP.Net Textbox Example

Change TextBox Font Style in ASP.Net – ASP.Net Textbox Example

– Write Below code in Style2 Button Click Event :

protected void Button2_Click(object sender, EventArgs e)
{
TextBox1.ForeColor = System.Drawing.Color.Green;
TextBox1.BackColor = System.Drawing.Color.White;
TextBox1.Font.Underline = true;
TextBox1.Font.Italic = true;
TextBox1.Font.Bold = false;
}

The ASP.Net TextBox Example Result is :

Change TextBox Font Style in ASP.Net - ASP.Net TextBox Example

Change TextBox Font Style in ASP.Net – ASP.Net TextBox Example

– In this ASP.NET Texbox Example post we got the knowledge about how to change TextBox Font Size and all Textbox style in ASP.Net

– Hope you enjoyed this ASP.Net TextBox Example Tutorials.

Enable TextBox, Disable TextBox and ReadOnly TextBox Control programmatically

Enable, Disable and ReadOnly TextBox Control programmatically

– Hi, Here we lean this asp.net tutorials, How to enable Textbox control, Disable TextBox control and Readonly Textbox control in ASP.Net C#.

– First we have to Design the ASP.Net Page with One TextBox along with Theree(3) Button Server Control. The ASP.Net Enable, Disable, Readonly TextBox control Design Code is below :

– write below code in head body tag:-

<table style=”width: 352px”>
<tr>
<td style=”width: 100px; text-align: right”> Enter Value :
</td>
<td colspan=”2″ style=”text-align: left”>
<asp:TextBox ID=”TextBox1″ runat=”server”>
</asp:TextBox></td> </tr> <tr>
<td style=”width: 100px; height: 26px”>
</td> <td colspan=”2″ style=”height: 26px; text-align: left”>
&nbsp;<asp:Button ID=”Button1″ runat=”server” OnClick=”Button1_Click” Text=”Enable” />
<asp:Button ID=”Button2″ runat=”server” OnClick=”Button2_Click” Text=”Disable” />
&nbsp;<asp:Button ID=”Button3″ runat=”server” Text=”ReadOnly” />
</td>
</tr>
</table>

Write below code for Enable TextBox:-

protected void Button1_Click(object sender, EventArgs e)
{
TextBox1.Enabled = true;
}

TextBox control Enable in ASP.Net

TextBox control Enable in ASP.Net

write below code for Disable TextBox:-

protected void Button2_Click(object sender, EventArgs e)
{
TextBox1.Enabled = false;
}

TextBox control Enable in ASP.Net

TextBox control Enable in ASP.Net

Write below code for ReadOnly TextBox:-

void Button3_Click(object sender, EventArgs e)
{
TextBox1.ReadOnly = true;
}

ReadOnly TextBox in ASP.Net

ReadOnly TextBox in ASP.Net

–  Here, we learnt problematically Enable, Disable, ReadOnlyTextbox control in ASP.Net TextBox Example.

– The same things we can do without Problematically like this:
Just SET the TextBox Property Enabled = True / False for Enable / Disable Textbox Control.

For ReadOnly SET TextBox Property ReadOnly = True / False for ReadOnly on/off Textbox.

– In above ASP.Net Tutorials, we have learn  How to enable Textbox control, Disable TextBox control and Readonly Textbox control in ASP.Net C#.

– I hope, will enjoy this  ASP.Net TextBox Example of  Enable, Disable, Readonly TextBox control of asp.net.

How to Change TextBox Control TextMode SingleLine, Password and MultiLine

change TextBox TextMode SingleLine, Password and MultiLine 

– Hi, Here we lean in this post, How to Change TextBox Control Mode, SingleLine Mode, MultiLine Mode, Password Mode in ASP,.Net C#.

– First we have to Design the ASP.Net Page with One TextBox along with Theree(3) Button  Control. The ASP.Net TextBox SingleLine Mode, MultiLine Mode and Password Mode Design Code is below :

write below code in head tag:-

<body></span>
<form id=”form1″ runat=”server”>
<table style=”width: 376px”>
<tr>
<td style=”width: 100px; text-align: right”>
TextBox :</td>
<td colspan=”2″ style=”text-align: left”>
<asp:TextBox ID=”TextBox1″ runat=”server”></asp:TextBox></td>
</tr>
<tr>
<td colspan=”3″ style=”height: 26px”>
&nbsp;<asp:Button ID=”Button1″ runat=”server” OnClick=”Button1_Click” Text=”SingleMode” />
<asp:Button ID=”Button2″ runat=”server” OnClick=”Button2_Click” Text=”PasswordMode”
Width=”112px” />
<asp:Button ID=”Button3″ runat=”server” OnClick=”Button3_Click” Text=”MultiLine”
Width=”112px” /></td>
</tr>
</table></form>
</body>

write below code for SingleLine TextBox:-

– SingleLine Mode means Default TextBox Control in ASP.Net simple allow to write in single line.
protected void Button1_Click(object sender, EventArgs e)
{
TextBox1.TextMode = TextBoxMode.SingleLine;
}

TextBox SingleTextMode in ASP.Net

TextBox SingleTextMode in ASP.Net

write below code for Password Mode TextBox:-

– Password Mode means Character show as a password charactre like small balck dots in TextBox Control in ASP.Net.

protected void Button2_Click(object sender, EventArgs e)
{
TextBox1.TextMode = TextBoxMode.Password;
}

TextBoxMode Password in ASP.Net

TextBoxMode Password in ASP.Net

write below code for MultiLineMode TextBox:-

– MultiLine Mode means TextBox control allow user to write in more then one line in ASP.Net.

protected void Button3_Click(object sender, EventArgs e)
{
TextBox1.TextMode = TextBoxMode.MultiLine;
}

MultiLine TextBoxMode in ASP.Net

MultiLine TextBoxMode in ASP.Net

The same things we can do without Programmatically like this:
Just SET the TextBox TextMode Property TextMode = SingleLine / MultiLine / Password for Change the TextBox TextMode.

– In above ASP.Net Tutorials, we have learn  How to change Textbox control TextMode in ASP.NEet C#.

– I hope, you will enjoy this  ASP.Net TextBox Example of  Change TextMode of TextBox Control.

How to visible TextBox programmatically in ASP.NET

How to visible / Hide  TextBox in ASP.Net C#

– Hi, Here we are going to learn , How to TextBox Control Visible and Hide OR Visible True/False  in ASP,.Net C#.

– First we have to Design the ASP.Net Page with One TextBox Control along with Two (2) Button  Control.
– The ASP.Net Design Code is below :

write below code in Head tag:-

<body>
    <form id=”form1″ runat=”server”>
<table style=”width: 304px”>
                        <tr>
                            <td style=”width: 100px; text-align: right”>
                                TextBox :</td>
                            <td colspan=”2″ style=”text-align: left”>
                                <asp:TextBox ID=”TextBox1″ runat=”server”></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td style=”width: 100px; height: 26px”>
                            </td>
                            <td colspan=”2″ style=”height: 26px; text-align: left”>
                                &nbsp;<asp:Button ID=”Button1″ runat=”server” OnClick=”Button1_Click” Text=”Visible” />
                                <asp:Button ID=”Button2″ runat=”server” OnClick=”Button2_Click” Text=”Hide” Width=”48px” /></td>
                        </tr>
                    </table></form>
</body>

write below code for visible TextBox Control:-

protected void Button1_Click(object sender, EventArgs e)
    {
        TextBox1.Visible = true;
    }

– In below figure we can see the Texbox Control as we clicked Visible Button.

– Visible Property = True;

Write below code for Hide/Invisible TextBox:-

protected void Button2_Click(object sender, EventArgs e)
    {
        TextBox1.Visible = false;
    }

– In below figure can not see the TextBox Control on webform as we clicked Hide Button.

– Visible Property = False;

TextBox Invisible in ASP.Net

TextBox Invisible in ASP.Net

– Here, We learnt programmatically Change the TextBox Visible True and False.
– The same things we can do without programmatically like this:
Just SET the TextBox Visible Property Visible  = True/ False  for Visible / Hide the TextBox Control.

– I hope, you will enjoy this  ASP.Net TextBox Example of  Visible True/False of TextBox Control.

How to change TextBox width programmatically in ASP.NET

change TextBox width programmatically in ASP.Net C#

– In this ASP.Net post we will discuss about  How to Change Width of TextBox Control Programmatically  in ASP,.Net C#.

– Here, we need to Design the ASP.Net Page with One TextBox Control along with the Two (2) Button  Control.
– The ASP.Net Design Code is below :

write below code in head tag:-

<body>
<form id=”form1″ runat=”server”>
<table style=”width: 304px”>
<tr>
<td style=”width: 100px; text-align: right”>
TextBox :</td>
<td colspan=”2″ style=”text-align: left”>
<asp:TextBox ID=”TextBox1″ runat=”server”></asp:TextBox></td>
</tr>
<tr>
<td style=”width: 100px; height: 26px”>
</td>
<td colspan=”2″ style=”height: 26px; text-align: left”>
&nbsp;<asp:Button ID=”Button1″ runat=”server” OnClick=”Button1_Click” Text=”Widht 100″ />
<asp:Button ID=”Button2″ runat=”server” OnClick=”Button2_Click” Text=”Widht 180″ /></td>
</tr>
</table>
</form>
</body>
write below code for width 100:-

protected void Button1_Click(object sender, EventArgs e)
    {
        TextBox1.Width = 100;
    }

– Below figure show the TextBox Control width = 100, when we clicked the First Button Width 100.

write below code for width 180:-

protected void Button2_Click(object sender, EventArgs e)
    {
        TextBox1.Width = 180;
    }

Set TextBox width in ASP.Net

Set TextBox width in ASP.Net

– Below figure show the TextBox Control width = 180, when we clicked the Second Button Width 180.

Change TextBox width in ASP.Net

Change TextBox width in ASP.Net

– In above post we get the ideas about How to change width of TextBox Control Programmtically in ASP.Net.

– We can do this thing without prgrammatically Just SET width Property of the TextBox Control.

– I hope you will like this ASP.Net TextBox Example Tutorials.

Create Simple Registration Form in ASP.Net

Create Registration Form with TextBox control in ASP.Net

– In this ASP.Net Tutorial we will learn, how to create simple Registration form with validation control in ASP.Net.

– For Design this form bring the Four TextBox Control and One Button Control and Four RequiredField Validator Control.

Simple Registration Form in ASP.Net

Simple Registration Form in ASP.Net

– write below code in Body tag:-

<body>
    <form id=”form1″ runat=”server”>
<table>
                        <tr>
                            <td style=”width: 100px”>
                            </td>
                            <td style=”width: 100px”>
                            </td>
                            <td style=”width: 100px”>
                            </td>
                        </tr>
                        <tr>
                            <td style=”width: 100px; text-align: right”>
                                Enter Name :</td>
                            <td style=”width: 100px”>
                                <asp:TextBox ID=”txtname” runat=”server” ></asp:TextBox></td>
                            <td style=”width: 100px; text-align: left”>
                                <asp:RequiredFieldValidator ID=”RequiredFieldValidator1″ runat=”server” ControlToValidate=”txtname”
                                    ErrorMessage=”Enter Name !!”></asp:RequiredFieldValidator></td>
                        </tr>
                        <tr>
                            <td style=”width: 100px”>
                                Enter Surname :</td>
                            <td style=”width: 100px”>
                                <asp:TextBox ID=”txtsurname” runat=”server” ></asp:TextBox></td>
                            <td style=”width: 100px; text-align: left”>
                                <asp:RequiredFieldValidator ID=”RequiredFieldValidator2″ runat=”server” ControlToValidate=”txtsurname”
                                    ErrorMessage=”Enter Suname !!”></asp:RequiredFieldValidator></td>
                        </tr>
                        <tr>
                            <td style=”width: 100px; text-align: right”>
                                City :</td>
                            <td style=”width: 100px”>
                                <asp:TextBox ID=”txtcity” runat=”server”></asp:TextBox></td>
                            <td style=”width: 100px; text-align: left”>
                                <asp:RequiredFieldValidator ID=”RequiredFieldValidator3″ runat=”server” ControlToValidate=”txtcity”
                                    ErrorMessage=”Enter City !!”></asp:RequiredFieldValidator></td>
                        </tr>
                        <tr>
                            <td style=”width: 100px; text-align: right”>
                                Pincode :</td>
                            <td style=”width: 100px”>
                                <asp:TextBox ID=”txtpincode” runat=”server”></asp:TextBox></td>
                            <td style=”width: 100px; text-align: left”>
                                <asp:RequiredFieldValidator ID=”RequiredFieldValidator4″ runat=”server” ControlToValidate=”txtpincode”
                                    ErrorMessage=”Enter Pincode”></asp:RequiredFieldValidator></td>
                        </tr>
                        <tr>
                            <td style=”width: 100px; text-align: right; height: 34px;”>
                            </td>
                            <td colspan=”2″ style=”text-align: left; height: 34px;”>
                                <asp:Button ID=”Button1″ runat=”server” Font-Bold=”True” Height=”32px” Text=”Submit”
                                    Width=”80px” OnClick=”Button1_Click” /></td>
                        </tr>
                        <tr>
                            <td style=”width: 100px; text-align: right”>
                            </td>
                            <td colspan=”2″ style=”text-align: left”>
                                <asp:Label ID=”Label1″ runat=”server” Font-Bold=”True”></asp:Label></td>
                        </tr>
                        <tr>
                            <td style=”width: 100px; text-align: right”>
                            </td>
                            <td colspan=”2″ style=”text-align: left”>
                            </td>
                        </tr>
                    </table></form>
</body>

 

write below code in Button click Event:-

 protected void Button1_Click(object sender, EventArgs e)
    {
        Label1.Text = “Form Submitted Successfully !!”;
    }

Simple Registration Form in ASP.Net

Simple Registration Form in ASP.Net

Simple Registration Form in ASP.Net

Simple Registration Form in ASP.Net

– I hope you will learn this ASP.Net TextBox Example Tutorials.

Simple Registration Form in ASP.Net

Simple Registration Form in ASP.Net

Check contain value in TextBox in ASP.Net

Check contain value in TextBox in ASP.Net using Contains()

– We will learn here in TextBox control Found the Value in TextBox Control OR Not with help of Contains() Funcation.

– The Contains() Function use to check the Value or Found the Value in TextBox Control OR Not.

 

– write below code in head 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=”Submit” />
                                </td>
                        </tr>
                        <tr>
                            <td style=”width: 100px; text-align: right”>
                                </td>
                            <td colspan=”2″ style=”text-align: left”>
                                <asp:Label ID=”Label1″ runat=”server” Font-Bold=”True”></asp:Label></td>
                        </tr>
                    </table> </form>
</body>

 

Write below code in Button Click Event:-

protected void btnsubmit_Click(object sender, EventArgs e)
    {
 if (txtvalue.Text.Contains(“meera”))
        {
            Label1.Text = “Value contain ‘meera’ !”;
        }
        else
        {
            Label1.Text = “Value Dosn’t contain ‘meera’ !”;
        }
}

TextBox Control Contains() in ASP.Net

TextBox Control Contains() in ASP.Net

 

TextBox control Contains() in ASP.Net

TextBox control Contains() in ASP.Net

– I hope you enjoy this ASP.Net TextBox Example Tutorials.

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.