I have a Textbox, a LinkButton and a RadioButtonList inside an UpdatePanel. When the button is clicked, the UpdatePanel shows matching items in the radiobuttonlist.
This works fine, but I now need to make the same happen OnKeyDown on the TextBox. I'm trying to cancel all AJAX requests in progress but not having much luck. Firstly, on every keypress the UpdatePanel posts back, so only one letter can be changed at a time. Secondly, the textbox loses focus on postback.
I need to show the list as normal, but OnKeyDown as well as when the button is pressed. This is what I have (control IDs shortened)
$('#textBoxId').live('keydown', function(e) {
if((e.keyCode >= 47 && e.keyCode <= 90) || e.keyCode == 13) {
Sys.WebForms.PageRequestManager.getInstance().abortPostBack();
$('#buttonId').click();
$('#textBoxId').focus();
}
});
Thanks for any insight.