答案:主题:.NET2.0环境下的Ajax选型和应用
研究需要解决的问题:1 Ajax 应用框架的选型及其性能对比2 如何应用 Ajax3 应用 Ajax 过程中应该着重注意的问题研究者: Jimmy.Ke时间: 2006-11-13一 Demo说明
Ajax Demo Web Site 是一个完整的 .NET Website ,其中包含 5 个 ASPX 页面及其对应的 CS 文件。为了方便对比, Demo 中使用了三种 Ajax 应用方式:一是使用微软提供的 Atlas 应用框架,二是使用 Ajax.NET Professional 开源框架,三是使用针对 Ajax 的单纯的 Javascript 包 Prototype 。三者对应的关联文件如下表所示:
应用方式 |
文件名称 |
描述 |
|
Default.aspx |
首页导航,列出四个 Demo 页面的链接 |
Atlas |
AtlasDemo.aspx |
使用 Atlas 实现 Product 的 CRUD 功能,通过 UpdatePanel 完成无刷新操作。 |
|
|
|
AjaxPro |
AjaxProDemo.aspx |
使用 Ajax.NET Pro 实现 Product 的 CRUD 功能,编辑、删除操作返回 true/false 的结果,通过 .NET DataGrid 控件实现页面数据列表的呈现( HTML )。 |
|
| |
|
AjaxProDemoSecond.aspx |
使用 Ajax.NET Pro 实现 Product 的 CRUD 功能,编辑、删除操作返回所有的 Product 列表,通过 .NET DataGrid 控件实现页面数据列表的呈现( HTML )。 |
|
| |
Prototype |
PrototypeDemo.aspx |
使用 Prototype 实现 Product 的 CRUD 功能,编辑、删除操作返回所有的 Product 列表, Client 和 Server 的数据以 JSON 格式传输。 |
|
| |
|
| |
|
Product.cs |
Product 实体类 |
请求 URL |
数据流量 |
说明 |
Prototype | ||
PrototypeServerResponse.aspx
?action=listProduct |
Request Count: 1
Bytes Sent: 380
Bytes Received: 2,150 |
获取 Product 列表,以 JSON 的格式返回,客户端使用 Javascript 脚本处理呈现。 |
Ajax.NET Pro ( Second ) | ||
ajaxpro/AjaxProDemoSecond,
App_Web_qgwv3twq.ashx |
Request Count: 1
Bytes Sent: 493
Bytes Received: 1,392 |
获取 Product 列表,以 HTML 的格式返回,客户端直接呈现。 |
Atlas | ||
AtlasDemo.aspx |
Request Count: 1
Bytes Sent: 827
Bytes Received: 6,391 |
获取 Product 列表, Server 完成 DataGrid 数据源绑定呈现。 |
请求 |
数据流量 |
说明 |
Prototype | ||
PrototypeServerResponse.aspx
?action=deleteProduct&productId=1 |
Request Count: 1
Bytes Sent: 446
Bytes Received: 1,891 |
传送 ProductId ,完成删除操作,并获取 Product 列表到 Client 端呈现。 |
Ajax.NET Pro ( Second ) | ||
ajaxpro/AjaxProDemoSecond,
App_Web_qgwv3twq.ashx |
Request Count: 1
Bytes Sent: 504
Bytes Received: 1,300 |
调用远程 RPC 接口,完成删除操作,并获取 Product 列表的 HTML 在 Client 端呈现。 |