3
Reply

How to put two actions in the controller with the same name and same parameter type?

Prabu Spark

Prabu Spark

4y
1.2k
5
Reply

Is is possible to put two actions in the controller with the same name and same no. of parameters and parameter type as shown below.

  1. [HttpGet]
  2. public ActionResult Index(int x)
  3. {
  4. return View();
  5. }
  6. [HttpPost]
  7. public ActionResult Index(int a)
  8. {
  9. return View();
  10. }

    Give there Httpverbs different

    Yes because you are using different verbs Get and Post, if you wanted two gets or two posts you could change the route

    Yes because you are using different verbs Get and Post, if you wanted two gets or two posts you could change the route