Various Types of Action Results and usage in Mvc
There are Different Types of action result in Mvc .Different Action result have different purpose.Let us understand the action result below.
ActionResult Types | Description | |||
---|---|---|---|---|
ViewResult: |
|
|||
PartialViewResult: | return a Partial view | |||
ContentResult: | return any type of content.By default, it is used to return plain text, but the actual content type can be explicitly defined (e.g. text/xml). | |||
EmptyResult: | equivalent of a void method | |||
FileResult: | Used to return binary content (e.g., if you want to download a file). | |||
HttpUnauthorizedResult: |
|
|||
JavaScriptResult: | Return a Js code | |||
JsonResult: | return object in jSon Format | |||
RedirectResult: | Used to perform an HTTP redirect to another URL. | |||
RedirectToRouteResult: | used to perform an HTTP redirect, but to a specific route rather than a URL. | |||
Comments
Post a Comment