AjaxPro 用法示例(参考)
2010-08-24 11:23
344 查看
1、修改web.config 在system.web节点下添加 以下为引用的内容: <system.web> <httpHandlers> <add verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/> </httpHandlers> 2、将你的.NET方法添加AjaxMethod属性 以下为引用的内容: [AjaxPro.AjaxMethod] public DateTime GetServerTime() { return DateTime.Now; } 3、在.NET方法中向客户端注册javascript,用以javascript使用 以下为引用的内容: namespace MyDemo { public class _Default { protected void Page_Load(object sender, EventArgs e) { AjaxPro.Utility.RegisterTypeForAjax(typeof(_Default)); } [AjaxPro.AjaxMethod] public DateTime GetServerTime() { return DateTime.Now; } } } 4、在客户端用javascript调用服务器端的方法,语法也很简单 以下为引用的内容: function getServerTime() { MyDemo._Default.GetServerTime(getServerTime_callback); // asynchronous call } // This method will be called after the method has been executed // and the result has been sent to the client. function getServerTime_callback(res) { alert(res.value); }
相关文章推荐
- ExtJS与AjaxPro结合的简单示例
- Ajax异步传值用法示例
- ajaxPro.dll用法解析
- ajax.dll 与 ajaxpro.dll的用法[摘自网络]
- Ajax.NET Pro(AjaxPro)——Class Examples(类示例)
- AjaxPro.NET实现TextBox智能获取服务端数据功能(Asp.net 2.0)(示例代码下载)
- Ajax异步传值用法示例
- ajaxPro.dll用法解析
- AjaxPro.NET实现TextBox智能获取服务端数据功能(Asp.net 2.0)(示例代码下载)
- AJAXPro用法
- AJAX用法示例详解
- AJAXPro用法(转)
- AjaxPro 在vb.net 中的用法(一)
- ajaxpro方法ajaxmethod调用示例
- AjaxPro.NET实现TextBox智能获取服务端数据功能(Asp.net 2.0)(示例代码下载)
- 关于AjaxPro用法
- AjaxPro.NET实现TextBox智能获取服务端数据功能(Asp.net 2.0)(示例代码下载)
- AjaxPro.NET实现TextBox智能获取服务端数据功能(Asp.net 2.0)(示例代码下载)
- ajaxpro 的用法
- Ajax使用例子 参考AjaxProject或Struts_Pro3_dingpiao