All the public methods of a Controller class are
called Action methods.
Action methods is responsible for accept the request from user and with the help of Model and passing the results back to the View.
Action method with the following restrictions:
Action method are return ActionResult.
If you want to a public action methods are not accessible from the URL. You decorate with NONACTION attribute.
E.g.
Action methods is responsible for accept the request from user and with the help of Model and passing the results back to the View.
Action method with the following restrictions:
- Action method must be public. It cannot be private or protected
- Action method cannot be overloaded
- Action method cannot be a static method.
Action method are return ActionResult.
If you want to a public action methods are not accessible from the URL. You decorate with NONACTION attribute.
E.g.
[NonAction]
public void AddressInfo(){
// some code inside here
}
public void AddressInfo(){
// some code inside here
}
[NonAction]
public ActionResult Address(){
// some code inside here
return View();
}
public ActionResult Address(){
// some code inside here
return View();
}

No comments:
Post a Comment