【发布时间】:2010-03-29 17:08:35
【问题描述】:
我在控制器上有 2 个操作:
public class CalculatorsController : Controller
{
//
// GET: /Calculators/
public ActionResult Index()
{
return RedirectToAction("Accounting");
}
public ActionResult Accounting()
{
var combatants = Models.Persistence.InMemoryCombatantPersistence.GetCombatants();
Debug.Assert(combatants != null);
var bvm = new BalanceViewModel(combatants);
Debug.Assert(bvm!=null);
Debug.Assert(bvm.Combatants != null);
return View(bvm);
}
}
当调用 Index 方法时,我得到一个空模型。当通过它的 url 直接调用 Accounting 方法时,我得到一个水合模型。
【问题讨论】:
-
你使用的是什么版本的 MVC?
-
MVC2 RTM 我相信,我如何验证应用程序实际上使用了正确的 MVC2 CTP/Beta/RTC/RTC2 等?
-
关注这篇博文,它应该会告诉你如何诊断你的应用正在使用哪个版本:bradwilson.typepad.com/blog/2010/03/…
标签: asp.net-mvc