Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Having razor @helper in App_code folder using ASP.NET MVC 3

Where can I find tutorials on how exactly get this to work?

I am trying to have @helper in App_code directory of my MVC3 app, so far when I try to use them in other razor pages, they cannot be found.

like image 311
Ray Avatar asked Feb 01 '11 18:02

Ray


1 Answers

You need to call the helpers as static methods of the page name.

For example, if you have a helper named HelpMe in App_Code/MyHelpers.cshtml, you would write

@MyHelpers.HelpMe(...) 
like image 171
SLaks Avatar answered Sep 27 '22 19:09

SLaks