AJAX and AutoPostBack
Hello Everyone and thanks for your help in advance. I am working on an application that utilizes AJAX to help populate a .Net webform. Here is generally how it works:
The form has a TextBox named ClientNumber. The textbox has an onkeyup attribute added that allows the user to type in a client name which in turn calls an AJAX function to create the appearance of an autocomplete dropdown box. When the user clicks on an item in the autocomplete list, it then populates the ClientNumber textbox with the corresponding client number. What I want to accomplish if possible, is to then have the autopostback (onchange) attribute of the textbox turned on so that when the numeric value is sent to the textbox, the autopostback will then occur, do a database lookup, and populate the rest of the fields on the form. However, when I do this, it does not seem to work properly. It seems to take the alpha input for the postback rather than waiting for the AJAX function to return the numeric value. Because of this, the database lookup fails. I am hoping there is some way to accomplish this as it would be much easier for the user to use the AJAX lookup and automatically populate the entire form rather than having to manually submit the form. Any help on this topic would be greatly appreciated. Thanks.