【发布时间】:2020-07-21 09:56:23
【问题描述】:
我正在尝试通过 ajax 请求向页面返回真/假值,但出现以下错误:
无法将类型“bool”隐式转换为“Microsoft.AspNetCore.Mvc.ActionResult” 这是我的代码:
public ActionResult CheckSignedIn()
{
return _signInManager.IsSignedIn(User);
}
我对编程比较陌生,因此我不确定要更改 ActionResult 的用途,也不确定 ActionResult 的含义。任何解决方案或解释将不胜感激
【问题讨论】:
-
会返回 Json(_signInManager.IsSignedIn(User));工作吗?
-
试试
return OK(_signInManager.IsSignedIn(User));。
标签: c# asp.net-core asp.net-identity