provide more details about your problem.i think you get problem while accessing keypressed character when key is pressed first time according to this i am providing you following a soln:
.aspx code
<asp:TextBox ID="txtUserId" runat="server" onkeyPress="return myfunction(event)></asp:TextBox>
javascript:
function myfunction(e)
{
var a=e.keyCode;
}
}
this e.keyCode gives you key pressed.i hope it will works