I am utilizing an autocomplete control which can be found here:
After making some modifications, my code looks like this:
var json_options;
json_options = {
script:'ReportSearch.aspx/GetUserList?json=true&limit=6&',
varname:'input',
json:true,
shownoresults:true,
maxresults:16,
callback: function (obj) { $('#json_info').html('you have selected: '+obj.id + ' ' + obj.value + ' (' + obj.info + ')'); }
};
$('#ctl00_contentModule_txtJQuerySearch').autoComplete(json_options);
In the C# Code behind file (aspx.cs), I have the following method:
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static string[] GetUserList(string input)
{
List<string> lUsers = new List<string>();
Server.DAL.SQLServer2005.User user = new Server.DAL.SQLServer2005.User();
Server.Info.AuthUser aUser = (Server.Info.AuthUser)HttpContext.Current.Session["AuthUser"];
List<Server.Info.User.UserDetails> users = user.GetUserList(aUser, input, 16, true);
users.ForEach(delegate(ReportBeam.Server.Info.User.UserDetails u)
{
lUsers.Add("(" + u.UserName + ")" + u.LastName + ", " + u.FirstName);
});
return lUsers.ToArray();
}
The error message I receive is:
Server Error in '/WebPortal4' Application. Unknown web method GetUserList. Parameter name: methodName
If I attempt to change any parameter names, I get an error indicating that they do not match. Despite ensuring everything is accurate, the error persists.
I would really appreciate any assistance on this matter.