How to detect ENTER KEY from a barcode scan in ASPX
<p>I have a textbox in WebForm, and user puts focus on that textbox and scan a barcode. The value scanned from the barcode gets put into the textbox. There is an ENTER KEY at the end of that value scanned. I would like to detect the ENTER KEY, but I dont know how to do it. </p>

<p>here is the code that popups message when a keypress occurs.</p>

<pre><code>&lt;script  type="text/javascript"&gt;
    $(document).ready(function () {
        $("#txtProductCode").on("keypress", function () {
            alert("asdasd");
        });
    });
&lt;/script&gt; 
</code></pre>

<p>I found a tutorial to check the entered value like  below</p>

<pre><code>if (e.keyCode == 13) ....
</code></pre>

<p>but I dont have the "e" object.... So how can I check the KeyCode on KeyPress</p>