0

In an ASP.MVC using angular, I have this structure

A folder 'App' (it's folder at root level) and some subfolders :

  • Controllers (angular)
  • Services (angular)
  • Views (*.cshtml)

In a Index.cshtml file, placed in '/App/Views/SubFolder/, I'd like use the code below (or other razor) :

@section scripts
{
    <script src="@Url.Content("~/App/Controllers/mycontroller.js")" type="text/javascript"></script>
}

I get this error: CS0103: The name 'Url' does not exist in the current context

I tried this solution : this solution but not work, same error. How can I solve this ? I'd like have intelissense too in this page.

Thanks,

TheBoubou
  • 19,487
  • 54
  • 148
  • 236
  • 2
    possible duplicate of [Error: The name 'Url' does not exist in the current context in asp.net mvc3](http://stackoverflow.com/questions/27229492/error-the-name-url-does-not-exist-in-the-current-context-in-asp-net-mvc3) – Wayne Ellery Jan 02 '15 at 23:36

1 Answers1

0

Sounds like the web.config may be missing from the views folder.

Paul Johnson
  • 1,417
  • 1
  • 17
  • 26