Before reading this article, I highly recommend you read my previous parts:
In this section, we will look at Action Execution event in the MVC life Cycle. However, I strongly recommend you refer to the previous articles on the same topic. Once the controller gets initialized then action invoker has to takethe decision saying which method to invoke, and this piece is done by Action Invoker in the life cycle. Action Invoker based on different method signatures present in the controller, identifies the exact method to be invoked.- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using MVC_Life_Cycle.Utils;
- namespace MVC_Life_Cycle.Controllers
- {
- public class HomeController : Controller
- {
- public ActionResult Index()
- {
- return View();
- }
- public ActionResult About()
- {
- ViewBag.Message = "Your application description page.";
- return View();
- }
- public ActionResult About(string msg)
- {
- ViewBag.Message = "Your application description page.";
- return View();
- }
- public ActionResult Contact()
- {
- ViewBag.Message = "Your contact page.";
- return View();
- }
- }
- }
In the above snippet, there are two 'About' methods. In this case, it has become ambiguous for action invoker to figure out how to choose which method to pick and hencehas produced the below error.

However, this can be easily fixed by applying any HTTP Verbs or Action Selectors like shown below.
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using MVC_Life_Cycle.Utils;
- namespace MVC_Life_Cycle.Controllers
- {
- public class HomeController : Controller
- {
- public ActionResult Index()
- {
- return View();
- }
- public ActionResult About()
- {
- ViewBag.Message = "Your application description page.";
- return View();
- }
- [HttpPost]
- public ActionResult About(string msg)
- {
- ViewBag.Message = "Your application description page.";
- return View();
- }
- public ActionResult Contact()
- {
- ViewBag.Message = "Your contact page.";
- return View();
- }
- }
- }






Arul RPosted Jan 27, 2016, 8:40 AM
Nice share
Raja TPosted Jan 27, 2016, 8:06 AM
Nice, Thanks for sharing
Ankit BansalPosted Jan 27, 2016, 6:25 AM
Nice share..thanks..
Vignesh ManiPosted Jan 27, 2016, 5:09 AM
Nice one
sreenivasa kPosted Jan 26, 2016, 3:08 PM
nice read