更新时间:2022-06-11 15:07:53
您需要ScriptMethod到您的Web方法,因为你需要发送响应为JSON。
You need to ScriptMethod to your web method because you needs to send the response as json.
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public bool SavePins(string saveData)
{
try
{
File.WriteAllText(string.Format("{0}{1}.shane", file_location, "pinsData"), saveData);
return true;
}
catch (Exception)
{
return false;
}
}