I use the following code to perform check again a database as a user types within the textbox
<script type="text/javascript">
function RefreshUpdatePanel() {
__doPostBack('<%= txtUsername.ClientID%>', '');
};
and
<asp:TextBox ID="txtUsername" runat="server" AutoPostBack="True"
onkeyup="RefreshUpdatePanel();" OnTextChanged="Code_TextChanged"></asp:TextBox>
Although this one works, the textbox loses focus after each keyup event. How can i fix that? (The whole thing resides within an update panel.)