Set ClientIDMode
to Static
as asp.net changes id of controls on rendering:
<asp:TextBox ID="TextBox1" runat="server" Width="150px" AutoPostBack="True"
ontextchanged="TextBox1_TextChanged" ClientIDMode="Static"></asp:TextBox>
or if you don't want to do that, then use the ClientID
property of the control in the client side code like:
var textBox1 = "<%=this.TextBox1.ClientID %>";
$("#"+textBox1).autocomplete({
source:items
});