How to Conver Small letter to Upper Case in Asp.Net



Here we will show when we input text into textbox then we have to convert into Uppercase if it is in small. We can create JavaScript function to convert text in uppercase.

CODE:

<div style="margin-left: 160px;margin-top:53px">
       Enter Charactor to SMALL2CAPS : <asp:TextBox ID="txtCode" runat="server" AutoPostBack="true"
            MaxLength="99" onkeypress="ToUpper(this.id)"
            ></asp:TextBox>
    </div>

JavaScript function:

<script type="text/javascript">
        function ToUpper(txt) {
            document.getElementById(txt).value = document.getElementById(txt).value.toUpperCase();
        }
    </script>

Related Posts

Previous
Next Post »

Thanks for comments.....