Do you see any errors in the browser console? Could be lots of things. First off
$(txtOldAddress).autocomplete({
what is txtOldAddress? It looks like it's just an undeclared and undefined variable. If you think it is going to refer to this
<asp:TextBox ID="txtOldAddress" runat="server" Height="20px" Width="278px"></asp:TextBox>
then view the source of the page (remember js is on the client, it runs off what you see in the browser source, not what you see on your aspx page), do you see any element with an id of txtOldAddress? Even if there was such an element variable names don't automatically refer to html controls, you have to use getDocumentById.
Next you could have url referencing issues.
source: 'OldaddressHandler.ashx'
that will work as long as the ashx file is in the same folder as the content page. Is it? Can you guarantee it always will be? Then there is your ashx file, there could be problems there too. You really need to learn how to debug your client and server code so you can at least identify where various issues might be or at what point the code is failing.
Here is a basic template for getting autocorrect work, it assumes the relevant jQuery and jQuery UI files are correctly referenced and referenced before the script on the page.
<asp:TextBox runat="server" ID="txtOldAddress" />
<script>
$(document).ready(function () {
$("#<%=txtOldAddress.ClientID %>").autocomplete({
source: '<%=Page.ResolveUrl("~/OldaddressHandler.ashx") %>'
});
});
</script>
public void ProcessRequest(HttpContext context)
{
string term = context.Request.QueryString["term"];
var data = Enumerable.Range(1, 3).Select(i => new { label = term + " " + i.ToString(), value = i.ToString() });
var s = new System.Web.Script.Serialization.JavaScriptSerializer();
context.Response.ContentType = "text/json";
context.Response.Write(s.Serialize(data));
}
Note I use Page.ResolveURL to get my urls so I don't have to worry about their location relative to the page, and I use ClientID to get the proper ID for the textbox.