現在,我有一個動作只從我的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