jquery 获取c#的返回值,long的值为什么会四舍五入
我在cs页面有入下方法
[WebMethod]
public static long Get()
{
return 5311806010885163116;
}
前台用ajax方法获取
$.ajax({
type: "POST",
contentType: "application/json",
url: "Default.aspx/Get",
data: _data,
cache:false,
dataType: "json",
success: SetData,
error: function(x, e) {
alert("e")
}
});
function SetData(result) {
alert(result.d) //显示的是5311806010885163000
}
如果cs代码中 返回值设置成string 则不会有问题。
该问题有什么好的解决方案吗