Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Unable to get property 'webServiceFailedNoMsg' of undefined or null reference

$
0
0

hello,

I am using a AutoCompleteExtender when I try to run it I get an error, 'Unable to get property 'webServiceFailedNoMsg' of undefined or null reference' when it try to call it's service methods, here my code below. The service method is used to pull a list of patient last name from the databased based on what the user typed in.

My UI code.

<asp:TextBox ID="txtLastName" runat="server" Width="250px" /><ajaxToolkit:AutoCompleteExtender runat="server" ID="aceLastName" TargetControlID="txtLastName"
        ServiceMethod="GetLastNameCompletionList" ServicePath="../UiHelper/PatientServiceForAutoSuggest.asmx"
        MinimumPrefixLength="2" CompletionInterval="1000" EnableCaching="true" CompletionSetCount="20" DelimiterCharacters=";, :"></ajaxToolkit:AutoCompleteExtender>

Service Method: PatientServiceForAutoSuggest.asmx

/// <summary>
    /// Summary description for PatientServiceForAutoSuggest
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
    // [System.Web.Script.Services.ScriptService]
    public class PatientServiceForAutoSuggest : System.Web.Services.WebService
    {
        private Guid _UserID;

        [System.Web.Services.WebMethod]
        [System.Web.Script.Services.ScriptMethod]
        public string[] GetFirstNameCompletionList(string prefixText, int count, string contextKey)
        {
            List<string> lst = new List<string>();

            try
            {
                _UserID = (Guid)Session["_UserID"];

                DataTable patients = UserFacadeAccess.MCLUserInactivePatientsSelect(_UserID);

                foreach (DataRow row in patients.Rows)
                {
                    if (!lst.Contains(MCLCommon.MCLCommonObject.CaseRules.ApplyCases(row["FirstName"].ToString())))
                    {
                        lst.Add(MCLCommon.MCLCommonObject.CaseRules.ApplyCases(row["FirstName"].ToString()));
                    }
                }
            }
            catch (Exception ex)
            {
                CommonFacadeAccess.LogError(ex, _UserID);
            }

            return lst.ToArray();
        }
}


Viewing all articles
Browse latest Browse all 5678

Trending Articles