当我建立的 Web Service 和引用的文件都在 文件夹下时,就出现:
Only Web services with a [ScriptService] attribute on the class definition can be called from script. 的错误.
放在根目录下是不会的,请问 config 文件需要怎么修改?
ScriptService 这个东西是有添加的.只是config的问题.
...全文
2757打赏收藏
JS访问WebServices的问题
当我建立的 Web Service 和引用的文件都在 文件夹下时,就出现: Only Web services with a [ScriptService] attribute on the class definition can be called from script. 的错误. 放在根目录下是不会的,请问 config 文件需要怎么修改? ScriptService 这个东西是有添加的.只是config的问题.
Only Web services with a [ScriptService] attribute on the class definition can be called from script. 的错误.
-------------
这个错误按字面理解,应该是webservice的.cs文件的类名前必须加上: [System.Web.Script.Services.ScriptService]
public class 你的WebService类名 : System.Web.Services.WebService
{
//...