weixin_33698823 2013-06-26 23:46 采纳率: 0%
浏览 68

如何在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

  • 写回答

2条回答 默认 最新

  • weixin_33725272 2013-06-26 23:52
    关注

    Visual Studio actually has a nice way of including missing namespaces. Right click on WebMethod (or whatever is not recognized), mouse over the submenu that says Resolve and then select using System.Whatever which will be your missing namespace.

    This is a nice feature that allows you to include namespaces without having to look them up.

    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料