What are Action Methods in ASP.NET MVC?

I already explained about request flow in ASP.NET MVC framework that request coming from client hits controller first. Actually MVC application determines the corresponding controller by using routing rules defined in Global.asax. And controllers have specific methods for each user actions. Each request coming to controller is for a specific Action Method. The following code example, “ShowBooks” is an example of an Action method.

public ViewResult ShowBooks(int id)
{
  var computerBook = db.Books.Where(p => P.BookID == id).First();
  return View(computerBook);
}
Tagged , . Bookmark the permalink.

Leave a Reply