开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜