You have to use jquery for that, bellow is the example
<script type="text/javascript">
$("#TextBoxCaption").keypress(function () {
});
</script>
there is no keypress event in server side
<asp:textbox id="TextBoxCaption" runat="server" ontextchanged="TextBoxCaption_TextChanged" autopostback="true" >
ontextchanged only works when you lost focus from text box and when you give AutoPostBack="true"