Reputation: 93
The type or namespace name 'Script' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
it gives error in the following line "System.Web.Script.Services.ScriptService"
i have included name space of system.web
Upvotes: 5
Views: 7113
Reputation: 470
Add targetFramework to you web.config file.
<compilation debug="false" strict="false" explicit="true" **targetFramework="4.0"** />
It usually happens when you migrate codes particularly web methods from an older version, say .net 3.5 to a newer version.
Arun
Upvotes: 1
Reputation: 1067
look into C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025\ and see if you find System.Web.Extensions.dll or the path if you don't have the dll you can Download and install the ASP.NET AJAX 1.0 from http://www.microsoft.com/en-us/download/details.aspx?id=883
Upvotes: 1
Reputation: 60942
Two problems:
System.Web.Script.Services.ScriptServiceAttribute
exists in the System.Web.Extensions
assembly, not System.Web
. Make sure you're referencing the System.Web.Extensions
assembly in your project.Once I referenced System.Web.Extensions, the following compiled for me:
System.Web.Script.Services.ScriptServiceAttribute ss;
Upvotes: 10
Reputation: 60075
Google is your best friend. MSDN second.
ScriptServiceAttribute Class
Namespace: System.Web.Script.Services
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
did you add reference to this dll?
Upvotes: 5