星空网 > 软件开发 > ASP.net

MVC Action返回Json

Action
[HttpPost]
        public ActionResult Edit(Study_CourseHourModel model)
        {
            if (ModelState.IsValid)
            {
                model.UId = LoginUserId;
                bool flag = BLLControl.Study_CourseHourBLL.Update(model);
                if (flag)
                {
                    return this.Json(new { Result = 1, Msg = "操作成功"  }, JsonRequestBehavior.AllowGet);
                }
                return Json(new { Result = 2, Msg = "操作失败" }, JsonRequestBehavior.AllowGet);
            }
            return ActionResult_ModelErrors();

        }

 
Js:
   $("#editCH").click(function () {
        $("form").ajax({
            type: "POST",
            dataType: "json",            url: "/Member/CourseHour/Edit",
            success: function (data) {
                showTips("操作成功");
                window.location.href = "/Member/CourseHour/Index?courseId=" + $('#Study_Course').val();
            }
        });
    });  

 




原标题:MVC Action返回Json

关键词:JS

JS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

股价暴跌98%!全球最大奢品电商Farfetch面临破产:https://www.kjdsnews.com/a/1692202.html
Meta旗下社交平台Threads在欧洲市场推出!:https://www.kjdsnews.com/a/1692203.html
Tiktok玩家第109篇:美区封店潮即将到来和无店可用的解决方案!:https://www.kjdsnews.com/a/1692204.html
美国报税常见的5个税表:https://www.kjdsnews.com/a/1692205.html
亚马逊物流费用更新后,超六成卖家成本暴涨!:https://www.kjdsnews.com/a/1692206.html
库迪咖啡越南首店开业!已进军六个海外市场:https://www.kjdsnews.com/a/1692207.html
跨境支付百科——巴西支付篇:https://www.kjdsnews.com/a/1836648.html
大福地快捷酒店预订 大福酒店怎么走:https://www.vstour.cn/a/365187.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流