All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
delphi高级vcl组件状态栏组件(TStatusBar)使用实例
PHP,5.0,的变化与PHP,6.0,展望_php资料_编程技术
在ASP.NET中利用VWD操作数据库简介_[Asp.Net教程]
PHP爱好者简单学习PHP处理表单的方法_php资料_编程技术
如何解决php能连接mssql但读取不到表_[PHP教程]
ASP.NET2.0数据库之SQL,Server安全性_[Asp.Net教程]
ASP.NET生成高质量缩略图通用函数
SQL Server安装文件挂起错误解决办法_[SQL Server教程]
图片在已知大小容器中的水平垂直居中实例_[Html教程]
卸载SQL Server2000后不能再次安装的问题解决方法_[SQL Server教程]
Reading number is top 10 pictures
In the world the most mysterious 21 place landscape2
俄罗斯台球天后惊艳魅惑2
Is said to be a Chinese female artist fame explicit pictures before2
这才是真正的人体艺术1
So beauty, will let you spray blood8
Absolutely shocked. National geographic 50 animal photographys6
联通的3G无线网卡我只用了一天,看看流量......
The real super beauty2
擦地板的大叔太好了
Small QiShu -- ShuangShuangPan1
Download software ranking
Tram sex maniac 2 (H) rar bag14
Eclipse 4.2.1 For Win32
Jinling thirteen stock
Ashlynn Video2
Tram sex maniac 2 (H) rar bag10
功夫熊猫2(上集)
Tram sex maniac 2 (H) rar bag15
金山office2007
Boxer's Top ten classic battle3
徐若瑄成名作“魔鬼天使”
aaa published in(发表于) 2013/12/11 8:28:51 Edit(编辑)
ASP.NET,AJAX,Beta2,调用本地WebService的一些改变_.net资料_编程技术

ASP.NET,AJAX,Beta2,调用本地WebService的一些改变_.net资料_编程技术

ASP.NET AJAX Beta2 调用本地WebService的一些改变_.net资料_编程技术-你的首页-uuhomepage.com







发现最新版本的改动很大,下面就测试情况作一下说明(这里借用官方的例子):




1、首先建一个WebService 文件(HelloWorldService.asmx),代码如下:

<%@ WebService Language="C#" Class="Samples.AspNet.HelloWorldService" %>




using System;
using System.Web;
using System.Web.Services;
using System.Xml;
using System.Web.Services.Protocols;
using Microsoft.Web.Script.Services;




namespace Samples.AspNet
{




[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ScriptService]
public class HelloWorldService : System.Web.Services.WebService
{




[WebMethod]
public string HelloWorld(String query)
{
string inputString = Server.HtmlEncode(query);
if (!String.IsNullOrEmpty(inputString))
{
return String.Format("Hello, you queried for {0}. The "
+ "current time is {1}", inputString, DateTime.Now);
}
else
{
return "The query string was null or empty";
}
}
}
}
这里要说明的是[ScriptService] 属性,只有加上这个性属性,才能在页面中通过js进行异步调用;




2、建一个调用页面(AjaxScript1.aspx),如下:
<%@ Page Language="C#" %>
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">




http://www.w3.org/1999/xhtml">






















Search for

onclick="DoSearch()" />


















注意,这里的




放在

中了。




改变好像挺大!



























添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.