Thursday, December 20, 2012

JQuery Autocomplete "Internal Server Error"

Hello,

This is something that is very common for all of us to encounter. I encountered this N no. of times during my work and most of the times for all new reasons then before.

Here are a few things that you could look out for:

This error clearly mentions that it is a "Server Error" which means we could not get a proper response back from the server. So chk for these....

1. Make sure you are calling to the correct WebService and correct Method of the webservice.

2. The make sure you pass the correct name of the parameter as requested by the WebMethod.

3. The method should be marked as WebMethod in the WebService.

4. Debug through your Webmethod to see if it fails somewhere.

5. If you are not at all getting the Webmethod to hit (Which was precisely my case), then look for the
    [System.Web.Script.Services.ScriptService]
tag above your asmx.

To allow this Web Service to be called from script, using ASP.NET AJAX, you need to have the  following line on top of your WebService declaration

    [System.Web.Script.Services.ScriptService] 

Hope this helps...