Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

system.web doesnt contain definition for script

Tags:

asp.net-ajax

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

like image 375
Jaspal Avatar asked Jul 06 '10 15:07

Jaspal


1 Answers

Two problems:

  1. The class 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.
  2. When referencing an attribute explicitly, you'll need to provide its full name of "ScriptServiceAttribute", and not just "ScriptService".

Once I referenced System.Web.Extensions, the following compiled for me:

System.Web.Script.Services.ScriptServiceAttribute ss;
like image 55
Michael Petrotta Avatar answered Sep 19 '22 02:09

Michael Petrotta