In this article we will learn about Action Method. Basically it handles the incoming request and generate response.
All the public method of a controller class are called Action Method with some restrictions:
1) Action method must be public. It cant be private or protected.
2) Action method cant be static.
All the public method of a controller class are called Action Method with some restrictions:
1) Action method must be public. It cant be private or protected.
2) Action method cant be static.
Types of Action
Action returns multiples types of action like given below:
FileContentResult
Returns file content
JavaScriptResult
Returns script for execution
JsonResult
Returns JSON formatted data
RedirectToResult
Redirects to the specified URL
ViewResult
Received as a response for view engine
PartialViewResult
Received as a response for view engine
You can use any of this to your controller to handle request and respond to it.
Comments
Post a Comment