开发者

How do I generate links in nested folders in T4 for ASP.NET MVC?

We are using T4MVC to generate for us links to our scripts and content. We've added a Script folders to some of our areas, and we want T4MVC to generate links for them as well.

We've tried to modify it to add it as an line to T4MVC.tt.settings.t4, but unfortunately with no success. The links for the Areas/Webcard/Scripts folder haven't been generated:

readonly string[] StaticFilesFolders = new string[] {
    "Scripts",
    "Content",
    "App_Sprites",
    "Areas/Webcard/Scripts"
};

How do开发者_如何转开发 I generate links for a new folder when I add a folder to each area?


It doesn't look like StaticFilesFolders supports/recognizes the path delimiter. It does however process items recursively, so you may want to try just adding "Areas" to the StaticFilesFolders list instead of "Areas/Webcard/Scripts". This should allow you to then access the scripts like @Links.Areas.Webcard.Scripts.Script1_js.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜