现在,我有一个动作只从我的MVC应用程序中的索引页POST。但我想要一个处理所有页面帖子和POST Handler操作的通用处理程序操作,我想知道我刚刚来自的视图。我想要的是:任何想法?控制器和以前的视图
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult GenericPostHandler(NewAccountInfo info)
{
try
{
string currentview = //how to get View for which to handle the POST?
Persist();
return RedirectToAction(StepManager.GetNextStep(currentView));
}
catch
{
return View();
}
}
我建立一个工作流程。基本上,通过知道你来自哪个视角,我可以告诉你有什么看法。这是如何违背MVC的精神?我仍然使用控制器来执行动作路由,我只是试图减少重复代码并使其更通用。谢谢。 – Crios 2009-08-07 17:04:01