gpt4 book ai didi

javascript - AngularJs如何将Json字符串传递到$scope.msg=msg.data

转载 作者:行者123 更新时间:2023-11-28 05:27:39 25 4
gpt4 key购买 nike

public JsonResult Authe(string Email, string Password, bool ? Active) {
var x = (from n in db.Authntications where n.Email == Email && n.Password == Password select n).FirstOrDefault();
if (x != null) {
var xx = (from n in db.Authntications where n.Email == Email && n.Password == Password && n.Active == Active select n).FirstOrDefault();
if (xx == null) {
msg = "Your A/c not activated....";
}
} else
msg = "Your Account Details Not Valid please check Details You mentiond...";
return new JsonResult {
JsonRequestBehavior = JsonRequestBehavior.AllowGet
};
}

AngularJs

var ZmrSer = MyAuthneticService.Authen(Sucess);
$scope.msg = msg.data;
$('#modalSuccess').modal('show');

最佳答案

您应该从操作方法返回 Json 并允许 get 行为。

return Json(msg, JsonRequestBehavior.AllowGet); 

关于javascript - AngularJs如何将Json字符串传递到$scope.msg=msg.data,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39995262/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com