Greg opened the meeting. There were 2 new attendees that introduced themselves. Greg introduced our speaker for the night, and thanked our sponsors. Our meeting sponsor was Red Gate Software, who also donated a copy of SQL Compare as a door prize. Greg did a brief demo of the product.
The presentation proceeded as follows:
Discussed history of interactive web history. Options for providing user feedback. Discussed why AJAX provides a good technology for user feedback and is a good programming environment.
Will show how to create a web site with AJAX. It will be a mortgage calculator. (Available in downloads with slide deck)
Hello World Demo
Using Visual Studio 2005 TS, Bryan created an AJAX-enabled web site.
Created a single page that calls a webservice GetData.asmx.
Coded a script in the page that calls the JavaScript proxy for the webservice. (doWork()). The call to the web service takes three delegates
- OnComplete
- OnTimeout
- OnError
Coded up empty functions for each of these.
Set up a <div id="xxx"> to provide a place to put the returned data. Added code to OnComplete to put the resulting HTML in the <div>.
Added a button to trigger the call. Ran the example, pressed the button and saw the results returned from the web service.
Real Mortgage Calculation Application
Created webservice with methods
- CalculatePayment
- CalculateAmortization
- Defined class PaymentDetail that gets the detail of individual payments
Ran the service methods interactively in IE to show that it works
Showed a method that formats each month of amortization data as an HTML table row. The Amort method will return a full HTML table, instead of raw data (XML). This isn't ideal, since the data can't be reformatted on the client.
Added a stylesheet into the page.
Bryan discussed something that was brought up during the break, that is that UpdatePanels are not inherently bad, as some have said. The method he is showing is an alternative to them and is a more abstracted form of using AJAX. Update panels are simplier to use and require less coding, but are also less flexible.
Continued with putting the Javascript in the page to call the web methods on the service and to process the results.
Showed the web page and how the payment calculation is returned and displayed. Went on to show how the amortization method is called to show the pmt amortization schedule.
Obviously the example app lacks polish. Bryan listed a number of things that could be done to clean it up and make it more professional. However, even without these things, the example provides a good, real-world example of using AJAX for creating more responsive web applications that give users better, more immediate feedback.
Bryan reminded that the user interface is intended to communicate, not decorate. So don't overuse AJAX just because you can.
After the presentation, members turned in their eval forms. We had a good supply of door prizes tonight. We gave away several tee-shirt / USB Key sets, a copy of Component One Suite, Office Professional and the copy of SQL Compare.
Our next meeting will include a presentation by member Eric Johnson on Microsoft Office Sharepoint Services. Eric elaborated a bit on what he will cover. |