惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
小众软件
小众软件
MongoDB | Blog
MongoDB | Blog
Jina AI
Jina AI
G
Google Developers Blog
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
爱范儿
爱范儿
B
Blog
云风的 BLOG
云风的 BLOG
H
Hackread – Cybersecurity News, Data Breaches, AI and More
GbyAI
GbyAI
博客园 - 叶小钗
aimingoo的专栏
aimingoo的专栏
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
博客园_首页
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence

博客园 - jascha

Eclipse可视化基面设计方法 Eclipse RCP的解释 java学习步骤 JAVA中的开源框架 Javascript键盘响应及空格屏蔽 - jascha - 博客园 给Eclipse换个启动界面! 干嘛要序列化? Eclipse安装AJAX环境(ATF,DOJO,Extjs...) Eclipse快捷键 yui-ext~~~cool! 部署Tomcat环境 捣鼓Mashup Mashup,老调新唱~ 微软的新技术 久违,重逢 对网格技术应用的分析 比较集群、网格、P2P区别(表格阐释) 我的博客列表 开张大吉啦!
ASP.NET AJAX调用WS步骤
jascha · 2007-03-23 · via 博客园 - jascha

1.配置web.config (直接选择ASP.NET AJAX项目就不用特别配置了)
2.新建web服务:testws.asmx
3.在testws.cs文件中添加属性:(这点最重要)

[System.Web.Script.Services.ScriptService()]


4.新建aspx文件:
   添加一个ScriptManager:

<asp:ScriptManager ID="ScriptManager1" runat="server">
      
<Services>
                    
<asp:ServiceReference Path="hotdataws.asmx" />  
          
</Services> 
    
</asp:ScriptManager>


5.添加一个HTML button,onclick事件:

<input id="button" type="button" value="调 用" onclick="return OnbuttonGo_click()" />

6.JAVASCRIPT中添加事件:

function Button1_onclick() {
HelloWorld(Oncomplete);
}
 

Oncomplete(args)
{
  alert(args);
}