CodePlexProject Hosting for Open Source Software
Coming from event driven programming background, I am struggling to figure out which part of the code is getting executed when certain UI elements are being clicked. Is there any way in orchard to determine what controller and action is getting fired up.
I am curious if there is any technique applied to determine this.
It should be pretty plain by looking at the link url or form action, then comparing with routes.
Pardon my ignorence, where are all the routes defined ? What I know
1) It should be defined in the global.asax
2) It should be define in Routes file in the root folder.
Where in Orchard project ?
Typically you create Routes.cs in the root of your module, though it doesn't matter where you place it because Orchard will pick up your routes as long as the class implements the IRouteProvider interface.
Here's an example,
the Routes.cs from Orchard.Blogs:
If there is no Routes.cs defined for the modules what does that mean ?
It means you haven't created it yet.
In MVC all the routes end up in the RouteCollection. Same is for Orchard because it uses MVC. But in Orchard we can't afford to declare them in the Global.asax because we need extensibility. So what is actually done is that we provide an interface IRouteProvider
that you can implement to declare your routes in a module. then Orchard loads all those implementations for the active modules, in each active tenant, and at startup populates the RouteCollection with the results of those classes.
Are you sure you want to delete this post? You will not be able to recover it later.
Are you sure you want to delete this thread? You will not be able to recover it later.