Posted on: 10/7/2011 11:03:44 PM | Views : 292

I am trying to capture the keypress event of an asp.net textbox.
In the Default.ASPX.VB page, I haveFor Page_Load....:  TextBox1.Attributes.Add("OnKeyPress", "GetKeyPress()")
In the Default.ASPX Code page, I have
<Script>
Function GetKeyPress(){    alert("you Pressed " & event.KeyCode;}
</Script>
It catches teh event, but the message box always says "You Pressed 0", no matter what key i press.  Also, I would really like to know how to do this in VB instead of JavaScript, if it is possible.
Thanks
...

Go to the complete details ...