开发者

How to redirect to a PartialViewResult

开发者 https://www.devze.com 2023-02-11 01:08 出处:网络
How do I redirect to a PartialViewResult?I am having the error message: Error 1\'MvcUI.Controllers.ExpenseController.SaveAuthorization(string)\': not all code paths return a value

How do I redirect to a PartialViewResult? I am having the error message:

Error 1 'MvcUI.Controllers.ExpenseController.SaveAuthorization(string)': not all code paths return a value

public ActionResult SaveAuthorization(string ExpenseID)
     {

         RedirectToAction("AuthorizeEmployee");             
     }

     public PartialViewResult AuthorizeEmployee()
     {
         AuthorizeExpenseModel model = new AuthorizeExpenseModel(null, 0, "All");
         return PartialView("Aut开发者_高级运维horizeExpense_Details", model);
     }


You need to put

return RedirectToAction("AuthorizeEmployee");

in your SaveAuthorization action

0

精彩评论

暂无评论...
验证码 换一张
取 消