CS0103: The name 'Script' does not exist in the current context

Topics: Customizing Orchard
Apr 5, 2012 at 7:40 AM

Getting the script error when trying to use



As mentioned in the previous posts checked web.config and the config is same as the other modules. Is there anything else that I need to do to get the Script working.

<?xml version="1.0"?>

    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <remove name="host" />
      <remove name="pages" />
      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />

    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
        <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.WebPages" />
        <add namespace="System.Linq"/>
        <add namespace="System.Collections.Generic"/>
        <add namespace="Orchard.Mvc.Html"/>

    <compilation targetFramework="4.0">
        <add assembly="System.Web.Abstractions, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add assembly="System.Web.Routing, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add assembly="System.Data.Linq, Version=, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        <add assembly="System.Web.WebPages, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


Any help much apreciated thanks.

Apr 7, 2012 at 6:41 AM

There isn't enough information here to provide any help. Where are you trying to do that?

Apr 7, 2012 at 1:05 PM

I am trying to do that inside a view (Editor template) in one of my module. I am trying to populate a dropdownlist using jquery.



Apr 8, 2012 at 8:01 AM

Still not enough information. What is "the script error"?

Apr 8, 2012 at 8:08 AM

Its unable recognise the Script inside the view template. I have resolved the issue now. The problem is with the web.config inside the views directory. I didnot use the codegen to create the module. I have copied the config file inside views folder from the Blogs module to my module and that resolved the issue.

Thanks bertrandleroy for looking at my issue.

Jun 19, 2014 at 4:36 PM
Edited Jun 20, 2014 at 2:43 PM
@cmsNewbe - Updating the References to Orchard.Core and Orchard.Framework fixed it for me.