1. We'll start with a new ASP.NET MVC 2 Web Application, called EditorTemplate. We'll choose no to Unit Tests, as we won't need them for this example.
2. Create a new Model called Test, and give it 2 properties: Name & Message. We'll just be using a very basic example here, nothing too fancy.
3. In our Home Views folder, we'll add a new folder called EditorTemplates. The folder must be named EditorTemplates as MVC will look for this naming convention when using your template.
4. Right click on the folder and select Add -> View. We'll call it TestEditorTemplate and make it a partial view. Your editor template must be a Partial View.
5. Now, we'll add our markup to the Editor Template. First, it needs to inherit our Model (EditorTemplate.Models.Test). Then we just add TextBoxFor for each item in our Model.
6. In our Index View we'll inherit a List
7. In our HomeController, we'll need to create a List
8. Save this and run the application. The resulting page is ugly, but you can see that it took our List
9. We'll set a break point on the Index Post method. Change some data in each textbox, and then click the submit button. As you can see, the List
This simple example shows how easy it is to use EditorTemplates in MVC, and how to easily pass a List