Take a look at Marcind
‘s answer to this question. What you’re experiencing is a limitation of putting declarative views in the App_Code
folder.
Putting your helpers in App_Code works
but has certain limitations that
impact certain MVC scenarios (for
example: no access to standard MVC
Html. helpers)