OnTextChanged event is not working in my web page

Hiteshkumar Patel 21 Reputation points
2022-06-18T08:52:28.08+00:00

Hi,
i develop one small application to scan barcode i activate AutoPostBack =true but still i need to press enter key or tab to fire trigger.
below is my code

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="frmScanNew.aspx.cs" Inherits="frmScanNew" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.style1
{
height: 228px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div style="width: 290px; height: 230px">

    <table id="Table1" runat="server" border="1" style="Z-INDEX: 101; LEFT: 8px; WIDTH: 282px; POSITION: absolute; TOP: 8px; HEIGHT: 64px">  
        <tr>  
            <td class="style1">  
                <p>  

    <asp:TextBox ID="TextBox1" runat="server" Width="211px" OnTextChanged="TextBox1_TextChanged" AutoPostBack ="true"></asp:TextBox>  
                </p>  
                <p>  
    <asp:Label ID="lblMsg" runat="server" Text="BarCode Allready Scaned"   
        ForeColor="#FF3300" Visible="False"></asp:Label>  
                </p>  
                <p>  

   
<asp:Label ID="lblScan" runat="server" Text="Total Scan: 0" Font-Bold="True"
ForeColor="Blue"></asp:Label>
</p>
<p>
                   
</p>
</td>
</tr>
</table>
<br />
<br />
<script type="text/javascript">
window.onload = function () {
document.getElementById('<%= TextBox1.ClientID%>').focus();
};
</script>
<br />
<br />
<br />
<br />
<br />
<br />

</div>  
<asp:ListBox ID="ListBox1" runat="server" Width="138px" style="margin-top: 4px">  
    </asp:ListBox>    </form>  

</body>
</html>

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,254 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Hiteshkumar Patel 21 Reputation points
    2022-06-20T09:14:32.68+00:00

    Thanks @Albert Kallal i check and contact scanner Manufacturer and they show me where to set