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

推荐订阅源

L
LangChain Blog
阮一峰的网络日志
阮一峰的网络日志
WordPress大学
WordPress大学
博客园 - 司徒正美
罗磊的独立博客
D
Docker
Last Week in AI
Last Week in AI
爱范儿
爱范儿
M
MIT News - Artificial intelligence
V
V2EX
Google DeepMind News
Google DeepMind News
小众软件
小众软件
Apple Machine Learning Research
Apple Machine Learning Research
Microsoft Security Blog
Microsoft Security Blog
T
Tailwind CSS Blog
MyScale Blog
MyScale Blog
V
Visual Studio Blog
博客园 - 叶小钗
B
Blog RSS Feed
A
About on SuperTechFans
F
Fortinet All Blogs
T
The Blog of Author Tim Ferriss
Martin Fowler
Martin Fowler
P
Proofpoint News Feed

博客园 - 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);
}