There are a lot of questions, here and everywhere, regarding the impossibility of using HtmlHelper extension methods (like ActionLink) in an @helper (razor) method. Right now, in my project, I solved the problem passing as an extra parameter the current page (System.Web.Mvc.WebViewPage page) to the @helper, like in
@helper HelperFunction(SampleParameter sp, System.Web.Mvc.WebViewPage page)
and using it (trivially) as in
{
...
@page.Html.ActionLink("Title", "Action")
...
}
I would like to know if it's too stupid :-), and why. It would be better, of course, to have direct access to the current HtmlHelper of the page where the @helper is called, but, anyway... if this a good solution...
Andrea