function ReturnOperation(InventoryID) {
             //入库 接口
             if (confirm('你确认?')) {
                 $.ajax({
                     type: "post",
                     url: "xxx.aspx/InStorage",
                     data: "{InventoryID:'"+InventoryID+"'}",//注意,json 对象外面 加 双引号  
                     contentType: "application/json",
                     dataType: "json",
                     success: function (r) {
                         if (r.d =="1") {
              alert("入库成功");
                         } else {
                             alert("入库失败");
                         }
                     },
                     error: function (e) {
                         alert("错误是:" + e.responseText);
                     }
                 })
             } else {

             }
         }                

  这是前端code

    [WebMethod]  //注意添加引用,方法为静态
    public static string InStorage(string InventoryID)
    {
  
       return InventoryID;
    }

这是xxx.aspx 页面内的方法

相关文章:

  • 2021-07-06
  • 2021-11-19
  • 2021-12-21
  • 2022-03-12
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-18
  • 2022-12-23
  • 2021-09-07
  • 2022-12-23
  • 2021-08-21
相关资源
相似解决方案