在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
ASP.NET 2.0 AJAX中能够在客户端js中很方便地调用服务器Webservice,以下为一些调用的示例。笔者安装的ASP.NET 2.0 AJAX 版本为AJAX November CTP。 三个示例分别为:
<system.web.extensions>
<scripting> <webServices> <jsonSerialization> <converters> <add name="DataSetConverter" type="Microsoft.Web.Preview.Script.Serialization.Converters.DataSetConverter, Microsoft.Web.Preview"/> <add name="DataRowConverter" type="Microsoft.Web.Preview.Script.Serialization.Converters.DataRowConverter, Microsoft.Web.Preview"/> <add name="DataTableConverter" type="Microsoft.Web.Preview.Script.Serialization.Converters.DataTableConverter, Microsoft.Web.Preview"/> </converters> </jsonSerialization> </webServices> </scripting> </system.web.extensions> WEB服务1:WS1
using System;
using System.Web; using System.Collections; using System.Web.Services; using System.Web.Services.Protocols; using Microsoft.Web.Script.Services; using System.Data; WEB服务2:WS
using System;
using System.Web; using System.Collections; using System.Web.Services; using System.Web.Services.Protocols; using Microsoft.Web.Script.Services; 二、前台页面:
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services> <asp:ServiceReference Path="~/WS.asmx" /> <asp:ServiceReference Path="~/WS1.asmx" /> </Services> </asp:ScriptManager> Default页面: 三、JavaScript程序:
function dd()
} 示例代码:/Files/heekui/AJAXStudy.rar |
请发表评论