Action method in MVC
Action Method in MVC
1) When we create a controller in MVC it creates Default method Index which is called as
Action method
2) When you create a method in controller every method is public. means every action method
is public
3) When we create an Action method we can not create a method as static.
4) When we hit URL from the browser then it performs the MVC life cycle and finds a
controller and action method in return response to the user.
Let Understand How to create Action method in Controller
please choose controller and give controller name so when we create controller it creates
default method which is index method
as per image, we have created the Learn controller and create an Index method. we can
Action method
2) When you create a method in controller every method is public. means every action method
is public
3) When we create an Action method we can not create a method as static.
4) When we hit URL from the browser then it performs the MVC life cycle and finds a
controller and action method in return response to the user.
Let Understand How to create Action method in Controller
default method which is index method
as per image, we have created the Learn controller and create an Index method. we can
create multiple methods inside the controller.
using an action method we can return the model to view.
Read below links to understand ActionResult type
https://mvc-learn.blogspot.com/2020/08/actionresult-return-type-in-mvc.html
using an action method we can return the model to view.
Read below links to understand ActionResult type
https://mvc-learn.blogspot.com/2020/08/actionresult-return-type-in-mvc.html
Comments
Post a Comment