开发者

ASP.NET MVC: Is it possible to send error data to a non-POST page?

Since POST request is separate, I have to do all t开发者_Go百科he stuff I already did in a GET request again. So is it possible to redirect to the same page, but as a GET request?

I know it's kinda confusing...

[HttpPost]
public ActionResult Foo(...) {
    ...
    return View("Foo", modelWithErrorsData); // Returns POST, I need GET
}


How about RedirectToAction()?

return RedirectToAction("Err", model);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜