Right-click the Controller folder in the ASP.net MVC type project, select Add=>controller ... , some default code is inserted into the new controller.
Right-click ADD View in Controller's action methods, and insert some code into the new view. The code you insert when you create a new view differs depending on the context and your choice, and seems to have a large code generation capability.
Both of these generate the code using Visual Studio's T4 code generation template, the T4 template and the Codesmith template are the same principle. The T4 template generation code feature has long been in VS, but rarely known, a hidden feature of vs. The templates used for both of these features are in C:/Program files/microsoft Visual Studio 9.0/common7/ide/itemtemplates/csharp/web/mvc/codetemplates Table of Contents.
Copy the entire directory of the Codetemplates and put it under the project.
We can modify the template here, or we can add our own template, you can choose which template to add code. This implements the code template for custom asp.net mvc.