I looked around and couldn\'t find an easy solution.
I\'ve tried @GetUserName which doesn\'t work.
I\'ve tried @ { GetUserName which do
Trying to call a controller action method directly from your view is usually a sign of bad design.
You have a few options, depending on what you are trying to do:
(1) is usually my default approach, often incorporating DisplayTemplates and EditorTemplates
For (3), e.g.
public static class Util
{
public string MyUtilMethod(int blah)
}
And the view:
@Util.MyUtilMethod(1)