Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Introducing Asp.Net Ajax 4.0 Preview

1,733 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Introducing Asp.Net Ajax 4.0 Preview

  1. 1. 陈广琛 Microsoft ASP.NET MVP Baidu Web Front-End Engineer
  2. 2. ASP.NET AJAX 4.0 Features <ul><li>ADO.NET Data Service Client Library </li></ul><ul><li>ASP.NET AJAX Template </li></ul>
  3. 3. ADO.NET Data Service Client Library <ul><li>ADO.NET Data Service </li></ul><ul><ul><li>RESTful </li></ul></ul><ul><ul><li>Atom </li></ul></ul><ul><li>ADO.NET Data Service Client Library </li></ul><ul><ul><li>Proxy Class </li></ul></ul><ul><ul><li>CRUD Operation </li></ul></ul><ul><ul><li>Action Sequence (Batch) </li></ul></ul>
  4. 4. Connection <ul><li>Proxy Class </li></ul><ul><ul><li>Sys.Data.AdoNetDataProxy </li></ul></ul><ul><li>Simple and Easy </li></ul><ul><ul><li>var dataService = </li></ul></ul><ul><ul><li>new Sys.Data.AdoNetDataProxy( </li></ul></ul><ul><ul><li>“ DataService.svc”); </li></ul></ul>
  5. 5. CRUD - Query <ul><li>One Method Only </li></ul><ul><ul><li>dataService.query(“/Products”, </li></ul></ul><ul><ul><li>successCallback, </li></ul></ul><ul><ul><li>failureCallback); </li></ul></ul><ul><li>RESTful URL </li></ul><ul><ul><li>“ /Products?$orderby=Price&$top=10” </li></ul></ul><ul><ul><li>“ /Products?$filter= </li></ul></ul><ul><ul><li>Category eq ‘food’” </li></ul></ul>
  6. 6. CRUD - Insert <ul><ul><li>var newProduct = {…} </li></ul></ul><ul><ul><li>dataService.insert( </li></ul></ul><ul><ul><li>newProduct, </li></ul></ul><ul><ul><li>“ /Products”, </li></ul></ul><ul><ul><li>successCallback, </li></ul></ul><ul><ul><li>failureCallback); </li></ul></ul>
  7. 7. CRUD - Update <ul><ul><li>var product = products[i]; </li></ul></ul><ul><ul><li>dataService.update( </li></ul></ul><ul><ul><li>product, </li></ul></ul><ul><ul><li>successCallback, </li></ul></ul><ul><ul><li>failureCallback); </li></ul></ul>
  8. 8. CRUD - Remove <ul><ul><li>var product = products[i]; </li></ul></ul><ul><ul><li>dataService.remove( </li></ul></ul><ul><ul><li>product, </li></ul></ul><ul><ul><li>successCallback, </li></ul></ul><ul><ul><li>failureCallback); </li></ul></ul>
  9. 9. <ul><li>ADO.NET Data Service Client Library </li></ul>
  10. 10. ASP.NET AJAX Template <ul><li>Instantiate Declaratively </li></ul><ul><li>Data Binding </li></ul><ul><ul><li>One-Way </li></ul></ul><ul><ul><li>Two-Way </li></ul></ul>
  11. 11. JavaScript Syntax <ul><li>$create( </li></ul><ul><li>Sys.UI.DataView, { </li></ul><ul><li>serviceUri: “DataService.svc&quot;, </li></ul><ul><li>query: “/Products“ </li></ul><ul><li>}, {}, {}, $get(“productList&quot;) ); </li></ul>
  12. 12. Declarative Syntax <ul><li><body </li></ul><ul><li>xmlns:sys=“javascript:Sys” </li></ul><ul><li>xmlns:dataview=“javascript:Sys.UI.DataView” </li></ul><ul><li>sys:activate=“*” > </li></ul><ul><li><ul </li></ul><ul><li>sys:attach=“dataview” </li></ul><ul><li>dataview:datasource=&quot;{{ new </li></ul><ul><li>Sys.Data.AdoNetDataSource() }}“ </li></ul><ul><li>dataview:serviceuri=“DataService.svc&quot;> </li></ul><ul><li><li></li> </li></ul><ul><li></ul> </li></ul><ul><li></body> </li></ul>
  13. 13. <ul><li>ASP.NET AJAX Template </li></ul>
  14. 14. <ul><li>Contact me via http://catchen.biz </li></ul>

×