如何重定向到PartialViewResult

时间:2011-02-16 13:15:05

标签: asp.net-mvc asp.net-mvc-3

如何重定向到PartialViewResult?我收到错误消息:

  

错误1'MvcUI.Controllers.ExpenseController.SaveAuthorization(string)':并非所有代码路径都返回值

public ActionResult SaveAuthorization(string ExpenseID)
     {

         RedirectToAction("AuthorizeEmployee");             
     }

     public PartialViewResult AuthorizeEmployee()
     {
         AuthorizeExpenseModel model = new AuthorizeExpenseModel(null, 0, "All");
         return PartialView("AuthorizeExpense_Details", model);
     }

1 个答案:

答案 0 :(得分:3)

你需要把

return RedirectToAction("AuthorizeEmployee");
您的SaveAuthorization操作中的