I am doing some @helper inside the App_Code folder. The goal is to completely replace my old HtmlHelpers, written in a * .cs file, with a string builder and all other interesting stuff.
Anyway, in several places I use Url.Content in src tag attributes <img>. They worked great as HtmlHelpers. Now that I have received my code inside the * .cshtml file in the App_Code folder, the site does not want to compile:
CS0103: the name 'Url' does not exist in the current context
What is a good way to solve this problem? I would not want to have a relative path there instead of displaying the path.
source
share