首页 > 解决方案 > 以 JSON 形式返回页面状态

问题描述

我不需要将当前页面返回为return this.Page(),而是将其作为带有返回 url 的 JSON 返回 - 类似的东西return new JsonResult(new { redirectUrl = Url.Page(this.Page()) });

这可能吗?

标签: asp.net-coreasp.net-core-mvc

解决方案


我找到了——return new JsonResult(new { redirectUrl = this.Url })


推荐阅读