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

Reading number is top 10 articles
让我们一起认识YAML:YAML简介_php资料_编程技术
C#中动作类型控件应用实例
DataGrid行单击和双击事件实现代码_[Asp.Net教程]
使用PagedDataSource类实现DataList和Repeater控件的分页显示_[Asp.Net教程]
ASP.NET页面传数据的各种方法和分析_[Asp.Net教程]
用最有效的方式来扩大你网站的名声_JavaScript技术_编程技术
使用MS,SQL7的LINKED,SERVER第三篇_mssql学习_编程技术
安全攻略:PHP脚本木马的高级防范_php资料_编程技术
AJAX中JavaScript支持面向对象的基础_[AJAX教程]
利用XSLT来换XML的根_[XML教程]
Reading number is top 10 pictures
So beauty, will let you spray blood1
Rendez-vous Sleep with actress, three days to earn 600000
The beginning and end
美丽的少女1
可爱的狗熊们
30 beautiful school beauty5
Flow chart of breast implants
Sora aoi possession photo1
Gang rape
看到这个手速,决定过年就让我家猫帮我抢红包了。。
Download software ranking
WebService在.NET中的实战应用教学视频 → 第2集
Ashlynn Video3
jdk1.5
VC++6.0简体中文版
Eclipse 4.2.2 For Win64
jdk1.6 for windows
The cock of the Grosvenor LTD handsome
C#与.NET技术平台实战演练
I'm come from Beijing2
终极变速大师Speeder3.26
aaa published in(发表于) 2013/12/18 7:53:32 Edit(编辑)
ASP.NET,Ajax调用WCF服务的代码示例_.net资料_编程技术

ASP.NET,Ajax调用WCF服务的代码示例_.net资料_编程技术

ASP.NET Ajax调用WCF服务的代码示例_.net资料_编程技术-你的首页-uuhomepage.com

  本文的主要内容是通过ASP.NET Ajax调用WCF服务的代码示例。开发环境是:.NET Framework 3.5 Beta 2+Visual Studio 2005。


  准备:


  1、安装.NET Framework 3.5 Beta 2。


  ASP.NET Ajax调用WCF服务需要.NET Framework 3.5 Beta 2中的System.Web.Extensions.dll(3.5.0.0),System.ServiceModel.Web.dll支持。


  开始我安装的是.NET Framework 3.5 June 2007 Community Technology Preview (CTP),走了一些弯路。


  2、安装Visual Studio 2005 extensions for .NET Framework 3.0 (WCF & WPF)。


  3、检查IIS是否有.svc到c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll的映射,如果没有,建立映射,建立时取消“检查文件是否存在”的选择。


  开始:


  1、在VS 2005中新建一个Web Site项目。


  添加web.config,将改为


  2、在该项目中添加一个WCF Service,命名为CNBlogsWCFService.svc。




  3、修改App_Code中CNBlogsWCFService.cs的代码:



[ServiceContract(Namespace = "http://www.cnblog.com/")]
  public interface ICNBlogsWCFService
  {
  [OperationContract]
  string AddToFavorites(string blogID, string postID);
  }
  public class CNBlogsWCFService : ICNBlogsWCFService
  {
  public string AddToFavorites(string blogID, string postID)
  {
  return string.Format("收藏成功!BlogID:{0},PostID:{1}", blogID, postID);
  }
  }



添加到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.