Hi chinnu,
Check the id of your server control (TextBox) in final HTML output in browser using View Source (I assume you must be knowing how to check Source code of an HTML file in browser). Put the id directly into your javascript function:
$(document).ready(function () {
$('#myTextbox').autocomplete("Ashx/Handler.ashx",
{
delay: 2,
minChars: 2,
matchSubset: 1,
matchContains: 1,
cacheLength: 15,
selectFirst: true,
autoFill: false
}
);
});
and if you move the javascript function to somewhere else, just refer the file in your aspx page and use Response.Write to call the javascript function. See my answer for this question here:
Call JavaScript function on DropDownList SelectedIndexChanged Event[
^]
Hope this helps.
Happy Coding :)