I’ve written an Html Helper called DetailsForm to reduce repetition when displaying fields in a view. Within a view – actually a partial view, ascx file – I can refer to it like this:
Storyboard.Helpers.DetailsForm.LabelAndData(Html, m => m.id)
But would like to refer to it like this:
LabelAndData(Html, m => m.id)
A ‘using’ directive doesn’t seem to be allowed in the ascx file. Is there an equivalent?
you should be able to import the namespace in the top of your ascx, like so:
UPDATE
Reading your comment, I’m guessing your helper looks something like:
in which case you would call it like this in your view:
Hope that helps!