我试图重定向到从另一个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