How to access view generator parameters in ASP.NET MVC 3 T4 template?
I want to create custom template to generate view in ASP开发者_运维知识库.NET MVC 3. Inside the template, I want to get the name of the selected controller. Where can I find it?
Actually there are several things I want to find out:
- controller name: ...?
- action name: ...
- viewmodel name: Host.ViewDataTypeName
- view name: Host.ViewName
Have you read Scott Hanselman's blog on changing the MVC default templates?
It's also worth taking a look at Where can I find the API specification for MvcTextTemplateHost?
精彩评论