【发布时间】:2013-06-26 23:46:19
【问题描述】:
我正在尝试让我的 asp.net 解决方案与 jquery ajax 一起使用。我正在使用这个例子:
http://encosia.com/using-jquery-to-directly-call-aspnet-ajax-page-methods/
到目前为止我有这个,但它给了我关于它没有被定义的命名空间错误。 Page 和 WebMethod 未定义...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PDFLibrary.PDFLibrary
{
public partial class SaveStructure : Page
{
[WebMethod]
public static string GetDate()
{
return DateTime.Now.ToString();
}
}
}
有谁知道如何解决这个问题?
谢谢
【问题讨论】:
-
您没有包含使用
Page和WebMethod类所需的命名空间。 -
那些是哪些?
-
Page在System.Web.UI中。 msdn.microsoft.com/en-us/library/… WebMethod 在 System.Web.Services 中。 msdn.microsoft.com/en-us/library/… -
这在 .net 3.5 中可用吗?
-
System.Web.UI自 .NET 1.0 以来一直存在