Tuesday 7 November 2006

Tech Ed - Developing Rich Web Applications with ASP.NET Ajax


We attended a really cool lecture by Shanku Niyogi that discussed the two different / complementary approaches to developing Ajax applications; Server centric and Client centric.

Here are some of our notes that we made whilst in the lecture:

The Update Panel and how using triggers with an asyncPostbackTrigger & a postback trigger to causes a partial or full postback respectively, he also showed a timer example and wrapping a whole gridview in a update panel to allow it to update without a full postback.

The user experience can also be improved with an updateProgress control to show when an async update is in progress, this can be on per panel basis or any panel on a page. We can use the displayAfter property to only show the update information after a certain amount of time.

The Control toolkit which can be found at http://ajax.asp.net/default.aspx?tabid=47&subtabid=477 can add extra AJAX functionality really easily with little or no JavaScript. He showed how you can hide & show areas not always needed using the popupControl extender. He showed how we can make this disappear after the popup work has been complete by using the getProxyForCurrentPopup(this).Cancel()

He discussed the issue around how to handle state when using Ajax and recommended taking advantage of the profile store of SQL or AD or even sharepoint J This was demoed using a custom statebag type concept via javascript calls to the server side to store user state. He showed how this could be used anonymously with a non-persistent cookie or by using a login to gain identity. He also touched on saving your state and accessing it via a url. This potentially solves the problem of losing state by using the back button.

He then discussed how the MS AJAX library allows users to use a JavaScript pattern type library that is OO to wrap things such as Networking method calls from the client to the browser and back.

The networking stack which builds on top of web service architecture, allows you to return xml/strings and the library will convert to JavaScript objects. It will do all serialization/deserialization of objects & conversion of native .net objects.

He then demoed a cat conversation example which was first built as a normal web service which returns to a browser its heavy weight soap xml.
He then changed his web methods to add an extra decoration to [ScriptMethod]. Once compiled it returned a JavaScript object when you added a /js to the query string. This JavaScript is a clientside proxy object that handles all networking. You can call the proxy directly from JavaScript via async methods.

He discussed AJAX releases which included:

  • ASP.NET v1.0 core product release client & server components.
  • Will have more CTP features updated reg. incl. AJAX control toolkit.
  • RTM for end of year which will run on ASP.NET 2.0.
  • Will be fully integrated into VS code named Orcus.

Have a look at the latest AJAX release and try stuff out over here http://ajax.asp.net/Default.aspx

No comments: