hi,
I have some code where i'm calling a webservice via javascript, using the MicrosoftAjax.js library, the webservice returns an Employee object, but I keep getting this error:
error has occurred: A circular reference was detcted while serializing an object of type 'Myclass.Employee'
I don't understand why that is happening. javascript code looks like this:
try{
MyService.GetEmployee(id, onComplete, onError, onTimeout);
}
the code executes as I can debug and hit a breakpoint in the GetEmployee webservice, but after that method runs it never hits the onComplete function, it directly errors, so i'm guessing something is wrong in the return from the webservice.
Webservice looks like:
[WebMethod]
[System.Web.Script.Services.GenerateScriptType(typeof(Employee))]
public Employee GetEmployee (int id){
Employee emp = new Employee(id);
return emp;
}
I have it marked wi ...
Go to the complete details ...