public ActionResult Index()
{
Queries q1 = new Queries();
return View(q1);
}
public ActionResult Index(string id)
{
Queries q1 = new Queries(id);
return View(q1);
}
public ActionResult Select(string id)
{
return RedirectToAction("Index",id);
}
what is wrong…
It says:
The current request for action ‘Index’ on controller type ‘CompanyController’ is ambiguous between the following action methods:
System.Web.Mvc.ActionResult Index() on type LookUpForm.Controllers.CompanyController
System.Web.Mvc.ActionResult Index(System.String) on type LookUpForm.Controllers.CompanyController
Since the Action Index one doesnot have parameters and other have a string parameter, I think it must be valid.
You cannot have 2 actions on the same controller with the same name even if they take different parameters. The only way to disambiguate them is to use a different HTTP verb:
or if both actions need to be accessible with the GET verb you will have to either find a different name or write a custom action selector.