Problem with focus when using UpdatePanel and UpdateProgress
-
Hi, I am using AJAX to dynamically produce a DataList according to the input in a TextBox. I am using the 'OnTextChanged' event to achieve this and a problem that occurs is that I will lose focus in my TextBox as soon I begin to type anything. An easy solution for this would be to remove the TextBox from the UpdatePanel but as I am using the UpdateProgress to produce a neat loading gif each time the OnTextChanged event occurs I have to keep the TextBox inside the UpdatePanel right? I have seen a number of examples on the net which suggest using the LastFocus property but have had no luck getting that to work. Am I right in thinking that my problem cannot be solved with the LastFocus property as I also have an UpdateProgess in my code? I am very new to ASP.NET and would highly appreciate any advice with this - my code is fairly large so I'll enclose a snippet of it, that will hopefully make my problem a bit clearer: asp:TextBox ID="txtSearch" OnTextChanged="txtSearch_OnTextChanged" AutoPostBack="true" runat="server">
-
Hi, I am using AJAX to dynamically produce a DataList according to the input in a TextBox. I am using the 'OnTextChanged' event to achieve this and a problem that occurs is that I will lose focus in my TextBox as soon I begin to type anything. An easy solution for this would be to remove the TextBox from the UpdatePanel but as I am using the UpdateProgress to produce a neat loading gif each time the OnTextChanged event occurs I have to keep the TextBox inside the UpdatePanel right? I have seen a number of examples on the net which suggest using the LastFocus property but have had no luck getting that to work. Am I right in thinking that my problem cannot be solved with the LastFocus property as I also have an UpdateProgess in my code? I am very new to ASP.NET and would highly appreciate any advice with this - my code is fairly large so I'll enclose a snippet of it, that will hopefully make my problem a bit clearer: asp:TextBox ID="txtSearch" OnTextChanged="txtSearch_OnTextChanged" AutoPostBack="true" runat="server">