I'm trying to write a simple declarative html helper:
@helper Echo(string input) {
@input
}
The helper works fine if I embed it into the page I want to use it on. But if I move it to a separate .cshtml
file and place that file in the ~/Views/Helpers
directory, my view can't be compiled anymore because the helper is not found. According to Scott Gu's blog article on Razor it should work.
What am I doing wrong?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…