ASP.Net MVC Scribblings
  • Introduction
  • Introduction
    • My ASP.net MVC Scribblings
    • Test
  • ASP.net MVC
    • Routing
    • Passing Data in MVC
      • ViewData and ViewBag
      • ViewData / ViewBag
      • TempData
      • Session Variables
    • ModelBinder
    • Advantages of MVC over WebForms
    • Data Annotation
    • RAZOR
    • ActionName decorator for overloaded Controller actions
    • Security
      • CSRF
      • XSS
    • Shared Layout page
    • Custom Claims-based Windows Authentication in ASP.net MVC 5
Powered by GitBook
On this page

Was this helpful?

  1. ASP.net MVC

RAZOR

namespace MVCOverloadedActions.Controllers {
    public class CustomerController: Controller {

        public ActionResult GetCustomer()
        {
            return Content("This is original simple Action");
        }

        [ActionName("GetCustomerByCode")]
        public ActionResult GetCustomer(string CustomerCode)
        {
            return Content("This is overloaded Action");
        }


    }
}

the URL: /Customer/GetCustomer would output content from first method i.e. "This is original simple Action"

the URL: /Customer/GetCustomerByCode would output content from first method i.e. "This is overloaded Action"

PreviousData AnnotationNextActionName decorator for overloaded Controller actions

Last updated 5 years ago

Was this helpful?