[Solved] ASP.Net MVC Error: The name Scripts does not exist in the current context

ramco1917
 
on Jul 31, 2021 06:31 AM
465 Views

Hi

Error - The name Scripts does not exist in the current context

@Scripts.Render("~/bundles/jquery")

Thanks

Download FREE API for Word, Excel and PDF in ASP.Net: Download
dharmendr
 
on Aug 02, 2021 04:58 AM

Hi ramco1917,

Make sure in ~/Views/Web.Config file System.Web.Optimization namespace present. If not add it.

<system.web.webPages.razor>
    <pages>
      <namespaces>
        <add namespace="System.Web.Optimization"/>
      </namespaces>
    </pages>
</system.web.webPages.razor>