Possible duplicate:
Using @helpers from another view in Razor ASP.Net MVC3
My environment: ASP.NET MVC3 with Razor.
I have reusable presentation logic in declarative helpers in a directory App_Datathat are defined as @helper bar() { /* markup */ }and are publicly available for any kind of use.
In addition, in the Razor regular view, I can write "private" helpers as such:
@functions {
public IHtmlString foo() { return new MvcHtmlString("foo"); }
}
I would like to have private functions inside my declarative helpers, OR, I would like to have private declarative helpers in my declarative help files. An alternative is to write the usual helper classes, but in this case I prefer markup, as it is less verbose and easy to maintain.
Why do you need this? You have an idea, and you want some markup; this is done by referring to the declarative assistant. But this DH is in a file full of other DHs that use common markup. So you want to move all this community to one place: a "private" declarative function / helper that only DHs in this file can see.