-
Notifications
You must be signed in to change notification settings - Fork 5
Getting started
janjongboom edited this page Aug 16, 2011
·
6 revisions
First add a reference to Moth.Core to your MVC project.
On top of the RegisterRoutes method, add the following line:
MothRouteFactory.RegisterRoutes(RouteTable.Routes);
If using MVC 3, add the following line to the RegisterGlobalFilters method:
// to make sure that Moth can post-process all requests, add a global filter
// this doesn't enable output caching by default, so no danger
filters.Add(new MothAction());
As MVC 2 doesn't support global filters, you will have to add the following attribute to every controller in your project. You can also create a BaseController that has this attribute, and let all the other controllers inherit from this base class:
[MothAction]
public class SomeController : Controller
To add support for the Moth methods in your views, add the following line to your web.config, under the <namespaces> section (f.e. \\system.web.webPages.razor\pages\namespaces):
<add namespace="Moth.Core"/>