标签:ret war get erro log css text app 获取
1、js
$.ajax({ type: "POST", contentType: "application/json", url: "activity-apply.aspx/BaoMing", data: "{ID:1}", dataType: ‘json‘, success: function (result) { $(result.d).each(function () { var datax=this[‘NeiRong‘]; if (datax == "报名成功!") { $(".touming,.baoming-success").show(); $("html").css("overflow-y", "hidden"); } else { alert(datax); } }); }, error: function (result, e) { alert(e); } });
2、C#,必须为static方法,使用不了跳转
session使用方式:HttpContext.Current.Session
[WebMethod] public static string GetAwards() { if (LotterySets.Count > 0) { return JsonConvert.SerializeObject(new { Success = true, Data = LotterySets, Msg = "获取成功" }); } else { return JsonConvert.SerializeObject(new { Success = false, Data = LotterySets, Msg = "奖项为空" }); } }
标签:ret war get erro log css text app 获取
原文地址:http://www.cnblogs.com/zhaoyihao/p/7479195.html