I've made a Razor @helper that takes some Examine search results:
@helper EventDates(SearchResult evnt)
... do stuff ...
{
This works fine in the view file, but when I move it out to app_code into a file called EventHelpers.cshtml (because I want to use it in several templates) and invoke it using @EventHelpers.EventDates(evnt) I get a compilation error:
Compiler Error Message: CS0122: 'System.IO.SearchResult' is inaccessible due to its protection level
Interesting, yes that did it. VS says the Examine. reference is redundant, but putting it in there solved the problem. I got another error at first, but managed to clear is using the mysterious force of the refresh.
Passing Examine search results to a @helper
I've made a Razor @helper that takes some Examine search results:
This works fine in the view file, but when I move it out to
app_code
into a file calledEventHelpers.cshtml
(because I want to use it in several templates) and invoke it using@EventHelpers.EventDates(evnt)
I get a compilation error:Is there a way around this?
I think you want
Examine.SearchResult
instead ofSystem.IO.SearchResult
?Interesting, yes that did it. VS says the
Examine.
reference is redundant, but putting it in there solved the problem. I got another error at first, but managed to clear is using the mysterious force of the refresh.Thanks Sebastiaan.
is working on a reply...