New install of OS and ASP.net software: I'm thinking I may need to install some sort of java or Jquery component that is presently missing perhaps? Would I see something for "Java" or "Jquery" under references?
Or perhaps I'm completely wrong and it's something else...error follows:
_____
Server Error in '/' Application.
Compiler Error Message: CS0103: The name 'Scripts' does not exist in the current context
Source Error:
Line 66:
Line 67: @section Scripts {
Line 68: @Scripts.Render("~/bundles/jqueryval")
Line 69: }
looks like you are missing the System.Web.Optimization DLLs. You need to add them in your project and then either use the using statement in your view or have them in your views folder's web.config file.
3v3rhart
Member
159 Points
317 Posts
CS0103: The name 'Scripts' does not exist in the current context
Nov 09, 2012 11:05 PM|LINK
New install of OS and ASP.net software: I'm thinking I may need to install some sort of java or Jquery component that is presently missing perhaps? Would I see something for "Java" or "Jquery" under references?
Or perhaps I'm completely wrong and it's something else...error follows:
_____
Server Error in '/' Application.
Compiler Error Message: CS0103: The name 'Scripts' does not exist in the current context
Source Error:
Line 66:
Line 67: @section Scripts {
Line 68: @Scripts.Render("~/bundles/jqueryval")
Line 69: }
Source File: c:\Documents and Settings\Alpha\My Documents\ASP MVC projects\MusicStore\Stop Points\MvcMusicStore05b\MvcMusicStore\MvcMusicStore\Views\StoreManager\Edit.cshtml Line: 68
_______
Project: MvcMusicStore Tutorial Step 5 - Edit / Environment: XP, MVC 4, VWS 2010 Express
CPrakash82
All-Star
18284 Points
2841 Posts
Re: CS0103: The name 'Scripts' does not exist in the current context
Nov 09, 2012 11:24 PM|LINK
looks like you are missing the System.Web.Optimization DLLs. You need to add them in your project and then either use the using statement in your view or have them in your views folder's web.config file.
3v3rhart
Member
159 Points
317 Posts
Re: CS0103: The name 'Scripts' does not exist in the current context
Nov 09, 2012 11:37 PM|LINK
Thanks
CPrakash82
All-Star
18284 Points
2841 Posts
Re: CS0103: The name 'Scripts' does not exist in the current context
Nov 10, 2012 12:05 AM|LINK
you need to add in View's web.config file like below
<namespaces>
.....
<add namespace="System.Web.Optimization" />
....
3v3rhart
Member
159 Points
317 Posts
Re: CS0103: The name 'Scripts' does not exist in the current context
Nov 10, 2012 12:22 AM|LINK
New error received having to do with views/shared/layout file. I created a new entry at forum link below.
http://forums.asp.net/p/1857711/5206610.aspx/1?p=True&t=634880891868910866
Thanks for your help.
BanksySan1
Member
3 Points
6 Posts
Re: CS0103: The name 'Scripts' does not exist in the current context
Jan 24, 2013 10:49 PM|LINK
Hi all,
I've just dont these steps, I've installed the optimization package via NuGet with:
I can see the assembly in the references and I have the namespace in the web config like so:
<system.web> <httpRuntime targetFramework="4.5" /> <compilation debug="true" targetFramework="4.5" /> <pages> <namespaces> <add namespace="System.Web.Helpers" /> <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.Web.Optimization" /> </namespaces> </pages> </system.web>but I still get the same error, that being CS0103: The name 'Scripts' does not exist in the current context.
I've tried rebuilding the solution... am I missing something, is there some other "cleaning" that needs to be done?