lundi 17 avril 2017

The name 'Url' does not exist in the current context in Areas Folder

I've WebAPI project. I've created Areas for admin panel. I've attached screenshot below for project structure.
enter image description here

In web.config of Areas->Views folder, I've mentioned:

<system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <pages pageBaseType="System.Web.Mvc.WebViewPage">
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.Optimization" />
        <add namespace="CallApp" />
      </namespaces>
    </pages>
  </system.web.webPages.razor>

In Web.Config of root folder, I've mentioned:

<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />

But I am getting The name 'Url' does not exist in the current context error in _Layout.cshtml page of Areas Admin.
enter image description here

Aucun commentaire:

Enregistrer un commentaire