MVC3 RC Razor @helper locations

2019-06-18 04:34发布

问题:

In the introduction to Razor on ScottGu's blog, he mentioned placing the @helpers inside Views\Helpers. I tried doing so in the RC and after a lot of searching, I found out that the helpers should be in the App_Code folder. I don't need my helpers in another assembly (especially if they're specific to this project), and having them way up in the App_Code seems ugly IMO. Is there a current solution to have the these helpers inside a View\Helpers folder?

回答1:

I am afraid they didn't yet implement this feature yet, at least not in the RC build.



回答2:

Now we have detailed blog post on this issue at first-hand by Scott Gu

ASP.NET MVC 3 and the @helper syntax within Razor