找不到类型或命名空间名称'webmethod'
我正在使用jquery,ajax和& .net来调用一个方法。我在网上看到很多例子说将[Webmethod]放在方法之上,但我一直在收到错误,找不到类型或命名空间名称'webmethod'。我已经把“使用System.Web.Services;”在顶部。还有什么需要做的?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services;
public partial class _Default : System.Web.UI.Page
{
[WebMethod]
public static string GetDate()
{
return DateTime.Now.ToString();
}
}
没有找到相关结果
已邀请:
3 个回复
拈吉勉犬姆
的引用。 由于您已经拥有正确的
语句,因此您很可能因此而错过了此错误
讹巳漓把备
傻零凰死授