我試圖重定向到從另一個POST方法POST方法POST方法,但似乎它試圖通過獲取重定向:嘗試重定向到從另一個
[HttpPost]
[Route("Users/NewUser")]
[SystemAuthorize(PermissionForm = Form.USERS, Permissions = PermissionValue.EDIT)]
public ActionResult NewUser(ConsultUserModel m) //This is called from Consult View by post
{
Debug.WriteLine("I'm here post");
UserInfoModel model = GetUserInfoModel();
return RedirectToAction("Edit", model);
}
[HttpPost]
[Route("Users/Edit")]
[SystemAuthorize(PermissionForm = Form.USERS, Permissions = PermissionValue.EDIT)]
public ActionResult Edit(UserInfoModel edit)
{
return View(edit);
}
當我打電話的行動結果服務器錯誤:
可能的重複[如何使用POST動詞重定向到頁面?](https://stackoverflow.com/questions/129335/how-do-you-redirect-to-a-page-using-the -post-verb) – Diado
「Post」應該改變服務器上的狀態。如果誤用,POST重定向看起來很危險。它本身不應該被瀏覽器支持 –
瀏覽器讓請求 – arslanaybars