asp.net-core - 以 JSON 形式返回页面状态
问题描述
我不需要将当前页面返回为return this.Page()
,而是将其作为带有返回 url 的 JSON 返回 - 类似的东西return new JsonResult(new { redirectUrl = Url.Page(this.Page()) });
这可能吗?
解决方案
我找到了——return new JsonResult(new { redirectUrl = this.Url })
推荐阅读
- python - 我可以使用 PIL imagegrab.grab() 截取特定显示吗?
- python - 主管错误无法执行 - 执行程序未能启动错误
- selenium - Selenium 网络驱动程序无法登录谷歌,
- mysql - [SQL]表以一列升序显示,当两条记录有相同数据时,以另一列降序显示
- javascript - 如何拥有
- c - 我的广度优先搜索算法有什么问题,它因分段错误而崩溃?
- javascript - Webpack 5 节点接口 - 无法从 node_modules 解析加载器
- regex - 在 Mac 终端上使用正则表达式重命名文件
- python - 如何通过python更新sqlite数据库中的特定单元格
- django - django-oscar 3.0 与贝宝付款