I have tried lots of solution but my problem isn't solved. What is the problem in this code omg.
I am posting this with fiddler :
{"No":1,"Name":"sss","LastName":"ssss","Age":1}
User Class:
public class Users
{
public Users() { }
public Users(int no,string name,string lastname, int age)
{
this.No = no;
this.Name = name;
this.LastName = lastname;
this.Age = age;
}
public int No { get; set; }
public string Name { get; set; }
public string LastName { get; set; }
public int Age { get; set; }
}
Webmethod :
[WebMethod]
public void updateUser(Users usr)
{
Users temp = userList.Where(i => i.No == usr.No).FirstOrDefault();
userList.Remove(temp);
userList.Add(usr);
}
This is the error :
{"Message":"Invalid web service call, missing value for parameter: \u0027usr\u0027.","StackTrace":" at System.Web.Script.Services.WebServiceMethodData.CallMethod(Object target, IDictionary`2 parameters)\r\n at System.Web.Script.Services.WebServiceMethodData.CallMethodFromRawParams(Object target, IDictionary`2 parameters)\r\n at System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext context, WebServiceMethodData methodData, IDictionary`2 rawParams)\r\n at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)","ExceptionType":"System.InvalidOperationException"}
Aucun commentaire:
Enregistrer un commentaire