This is a newbie question…
I am looking at the default asp.net mvc3 project and noticed that there is a controller called:
public class AccountController : Controller
I looked throughout the code and couldn’t find a place that specified AccountController maps to /Account/ for the URL.
I discovered that you can change the routing using routes.MapRoute(..) in the Global.asax, but I still don’t know where they specified that AccountController maps to /Account/.
If it is assumed from the class name, then does that mean all controller classes have to be named xxxxxController?
Yes you are right, all controllers need to follow the naming convention of an ending
"Controller".See the
ControllerNameproperty in the ASP.NET MVC code on CodePlex:Anyhow, you could change the naming convention by using your own controller factory.
Hope that helps.