ASP.NET jQuery Autocomplete - text field not responding after first search

Until I find the same problem in other issues on this site. Here's what I'm worried about:

I have an ASP.NET WebForms application with an UpdatePanel containing a search area where I have an ASP: TextBox, which I use to autocomplete jQuery.

$(document).ready(function() {
    $("#tabContainer_tabSearchBreaks_txtSearchName").autocomplete("AutoCompleteEmployee.ashx", { minChars: 3, maxItemsToShow: 10 });
});

All this works fine, but if I click on ASP: Button and process some code for the search area, javascript autocomplete no longer works.

Any ideas ???

There should be a solution to reset the text field to call js code.

[Refresh - more code] Here's what the refresh button does for a search area that is separate from the autocomplete code:

 try {
     int employeeID;
     string[] namelst = txtSearchName.Text.Split(new string[] {
         " "
     }, StringSplitOptions.None);
     employeeID = int.Parse(namelst[2].Substring(1, namelst[2].Length - 2));
     string name = namelst[0] + " " + namelst[1];
     var breaks = bh.ListBreaksForEmployeeByDate(employeeID, DateTime.Parse(txtFromDate.Text), txtToDate.Text.Length > 0 ? DateTime.Parse(txtToDate.Text).AddDays(1).AddSeconds(-1) : DateTime.Today.AddDays(1).AddSeconds(-1));

     if (breaks.Count() > 0) {
         lblEmployeeTitle.Text = "Breaks for " + name;
         gridSearchBreaks.DataSource = breaks;
         gridSearchBreaks.DataBind();
     }
 } catch {}

Hope this helps. Currently, I have hidden a tab that contains this problem for users.

+5
2

, ASP.NET UpdatePanel jQuery. : jQuery ( , ) , . , , jQuery UpdatePanel.

-, , $(document).ready, ( , ). , ASP.NET. , ? , . , $(document).ready ASP.NET AJAX pageLoad. , , , , , . , unbind , - . $(document).ready live ( , ..).

jQuery UpdatePanel, , , , , . , Dave Ward $(document).ready() pageLoad() ! ( ).

+10

, Firebug, , . ajax, , , , . javascript , , , , . , .

+1

All Articles