why this code is not working

<%@ Page Language="VB" %>
<script runat="server">



    Private sub Textbox1_KeyPress(KeyAscii As Integer)
    
    If KeyAscii = 13  Then
    Textbox2.backcolor=drawing.color.azure
    textbox2.focued()
    End If
    
    
    End sub
    
    Sub TextBox1_TextChanged(sender As Object, e As EventArgs)
    
    End Sub

</script>
<html>
<head>
</head>
<body>
    <form runat="server">
        <p>
            <asp:Label id="Label1" runat="server" text="box1"></asp:Label>
            <asp:TextBox id="TextBox1" runat="server" OnTextChanged="TextBox1_TextChanged"></asp:TextBox>
        </p>
        <p>
            <asp:Label id="Label2" runat="server" text="Box 2"></asp:Label>
            <asp:TextBox id="TextBox2" runat="server"></asp:TextBox>
        </p>
        <!-- Insert content here -->
    </form>
</body>
</html>

Change the textbox id and try it

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.