Các loại phụ của ActionResult là gì?
Các loại phụ của ActionResult là gì?
ActionResult là kiểu trả về cơ sở của action; các kiểu con phổ biến:
| Kiểu | Helper | Kết quả |
|---|---|---|
ViewResult |
View() |
Render view Razor |
PartialViewResult |
PartialView() |
Một phần view (AJAX) |
RedirectResult / RedirectToActionResult / RedirectToRouteResult |
Redirect(), RedirectToAction() |
302/ 301 |
ContentResult |
Content("text") |
Chuỗi |
JsonResult |
Json(obj) |
JSON |
FileResult (FileContentResult, FileStreamResult, PhysicalFileResult) |
File(...) |
Tải file |
Đăng nhập để tham gia thảo luận cùng mọi người.
Chưa có bình luận nào
Hãy là người đầu tiên chia sẻ suy nghĩ của bạn.