jQuery调用Webservice传递json数组的方法

2020-05-24 21:39:36易采站长站整理

break;
case "sex":
student.Sex = stu[key];
break;
case "age":
int age;
if (Int32.TryParse(stu[key], out age))
{
student.Age = age;
}
else
{
student.Age = 0;
}
break;
default:
break;
}
}
}
return "导入学生成功!";
}
catch
{
throw new Exception("导入学生失败!");
}
}
}

需要注意的是,服务端参数名需要和客户端Json数组的key值相同,如上代码中,参数名都为students。

更多关于jQuery相关内容感兴趣的读者可查看本站专题:《jQuery扩展技巧总结》、《jQuery常用插件及用法总结》、《jQuery拖拽特效与技巧总结》、《jQuery表格(table)操作技巧汇总》、《jquery中Ajax用法总结》、《jQuery常见经典特效汇总》、《jQuery动画与特效用法总结》及《jquery选择器用法总结》

希望本文所述对大家jQuery程序设计有所帮助。