为什么我的RedirectToAction方法调用没有运行索引操作?

时间:2016-07-07 16:42:39

标签: c# asp.net-mvc

我对MVC Web开发很新,所以答案可能非常简单。我正在创建一个非常简单的MVC Web应用程序。我有一个POST方法,在单击一个保存按钮时执行,然后我的索引操作应该被调用,但永远不会。

[HttpPost]
  public RedirectToRouteResult SaveClimber(ClimberDto climber)
  {
    //method call that takes climber makes a calculation and saves to SQL dabase
    return RedirectToAction("Index");
  }

  public ActionResult Index()
  {
    var viewModel = GetViewModel();
    return View(viewModel);
  }

0 个答案:

没有答案