如何在c#中使用jquery ajax?

I am trying to get my asp.net solution to work with jquery ajax. I am using this example:

http://encosia.com/using-jquery-to-directly-call-aspnet-ajax-page-methods/

I have this so far, but it's giving me namespace errors about it not being defined. Page and WebMethod is not defined...

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();
        }
    }
}

Does anyone know how to fix this?

Thanks

查看全部
weixin_33698823
weixin_33698823
2013/06/26 23:46
  • c#
  • asp.net
  • ajax
  • jquery
  • 点赞
  • 收藏
  • 回答
    私信

2个回复