2021年2月10日星期三

Controller that returns JSON format not returning to target page

  1. Why is it that my controller can't manage to go to the target Index page after logging in?

    [HttpPost]  [ValidateAntiForgeryToken]  public JsonResult Login(FormCollection fc)  {      var isSuccess = false;      Array errors = null;        more code here...        return Json(new { infoMessage = errors, successMessage = "", Status = isSuccess, gotoUrl = string.Format("/MyAccounts/Index") }, JsonRequestBehavior.AllowGet);  }  

The motive is to redirect the page to Index but it returns the Json result document instead.
enter image description here

https://stackoverflow.com/questions/66147329/controller-that-returns-json-format-not-returning-to-target-page February 11, 2021 at 08:55AM

没有评论:

发表评论