【问题标题】:Passing parameter value from an action result to another in the same controller将参数值从动作结果传递到同一控制器中的另一个
【发布时间】:2019-06-01 06:23:39
【问题描述】:

我是 MVC 中的新手,并且很难将字符串参数值(subjectid)传递给另一个动作,这会导致同一个控制器。

我急需帮助。

Controller - ActionResult Content

Controller - ActionResult Forward

ActionResult 内容需要将票证内容传递给视图。我还能使用 RedirectToAction 吗?请提供任何其他解决方案。

【问题讨论】:

  • 请添加您的代码

标签: asp.net-mvc controller parameter-passing


【解决方案1】:

您是否尝试过使用 RedirectToAction()?你得到什么错误?如果有帮助,请看下面。

RedirectToAction with parameter

【讨论】:

  • 如果我使用 RedirectToAction 我将如何为可能的 ActionResult 内容呈现视图?
  • 你想在同一个请求中执行Controller - ActionResult Forward吗?我相信这会从某个视图执行/调用,您可以通过路由参数或查询字符串传递所需的参数。
猜你喜欢
  • 2012-07-19
  • 1970-01-01
  • 2012-02-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多