asp.net mvc - Call Controler not with full name -


i new asp.net mvc.we create controller 'admincontroller' call name of admin. how asp.net mvc handle don't need call controller full name?

the controller name specify in url not same class name, action name not same actual method on controller. there internal mapping between controller/action , class/method mvc when determining code needs executed.

the generic mapping rule is:

  • for controllers, take controller name (admin) , add suffix controller , search class name (admincontroller).
  • for actions, take name of action (details) , search method on controller same name (actionresult details() {}).

however, mvc supports explicit mapping of action method different name through actionname attribute. thus, have action called edit mapped method actionresult edituser() {} example.

it possible future versions of mvc add similar controllername attribute allows explicit mapping of particular controller name particular class. (in fact, hope do, solve problem providing different implementations of same controller name in different areas)


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -