-
Notifications
You must be signed in to change notification settings - Fork 5
Getting started
See NuGet gallery: Moth.
Download the Moth source, and run the '/Build/build.bat' script. Add the DLL that is generated in the Output
directory to your 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 Views/Web.config, under the \\system.web.webPages.razor\pages\namespaces
section:
<add namespace="Moth.Core"/>
A list of Moth features, can be found here: Home.