Home > Microsoft .Net Development News > Using ASP.NET AJAX for large-scale Web applications
Microsoft .Net Development News:
EMAIL THIS

Using ASP.NET AJAX for large-scale Web applications

By George Lawton, Contributor
18 Apr 2007 | SearchVB.com

.NET Essentials Channel
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google

Our ASP.NET AJAX series
In this three-part series, SearchVB.com takes a close look at ASP.NET AJAX development.

Part 1 takes a look at what makes programming with ASP.NET AJAX different from programming with ASP.NET.

Part 2 considers the capacity for ASP.NET AJAX applications to operate faster, and on a larger scale, than traditional ASP.NET apps.

Part 3 examines the security concerns raised by ASP.NET AJAX development and offers some thoughts on how to combat them.
One of the key benefits of Ajax is the ability to precisely deliver data where it is needed to parts of the interface in order to reduce the overall bandwidth and server load. In other words, a page refresh occurs only on the part of the page where data is changing, and the rest of the page remains static.

"Things like the script manager and the update control panel allow different parts of the page to perform partial rendering," said Brian Finnerty, director of marketing for InnerWorkings, a Windows programming consultancy. "With the update control panel, you can enable partial updates and can control where updates are rendered on the page."

As one example of this, Phanfare.com, a photo sharing application, is using ASP.NET AJAX to make it easier for users to make changes to their photo albums, which may consist of thousands of thumbnail images.

Michael Cichowski, software engineer at Phanfare, praised JavaScript's rich interactivity. "In our case, you want to refresh a portion of a page with 1,000 photos. You don't want to refresh all of them when you want to upload one little widget," he said. "This increases the interactivity and the richness and takes off some of the load from the server."

However, as an ASP.NET application, Phanfare had to be crafted carefully in order to get the maximum scalability.

As Jeff Prosise, co-founder of .NET consultancy Wintellect, put it, "Ajax is good at minimizing traffic over the wire. But ASP.NET pages can store the state in a hidden input field.
In one of the demos Wintellect performed, its developers were able to replace 50 to 100 kilobytes of viewstate data with a 10-byte callback.
If you are not careful, you can significantly slow down the bandwidth."

ASP.NET pages typically render out a large tag that is stored as a viewstate, he noted. ASP.NET transmits viewstate up to the server by default because the code on the server might need to make a change to one of the controls.

"In the traditional ASP.NET model, it is not the pages themselves that are stored in the viewstate -- it is the state of the pages," Prosise noted, adding that it is quite common to have 50 kilobytes stored in viewstate.

When you design a page in ASP.NET AJAX, though, code can be written so that no viewstate goes back up, Prosise said. In turn, JavaScript code on the client can be used to update that state, plus any controls that need updating.

Prosise recommend replacing postback functions with callback in Ajax, which, if done right, can reduce the data going over the wire by three orders of magnitude.

"The key is getting rid of the viewstate and not having to round trip it. You don't need to send it up and down the wire every time," he said. "It is easy to replace those heavy postbacks with lightweight callbacks. It makes the whole thing more scalable because you are not processing as much data on the server as you were before."
More on ASP.NET AJAX
ASP.NET AJAX Learning Guide

Tip Series: Get started with ASP.NET AJAX development: Part 1  |  Part 2  |  Part 3

Prosise continued: "In an ASP.NET AJAX application, a programmer can do away with the postback, and when the user clicks a button, the application just sends a lightweight Ajax callback to the server. This lets the application be more precise."

The amount of bandwidth a programmer can save depends on the nature of the callback. In one of the demos Wintellect performed for SearchVB.com, its developers were able to replace 50 to 100 kilobytes of viewstate data with a 10-byte callback.

Tags: ASP.NET and Ajax developmentVIEW ALL TAGS

Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
ASP.NET and Ajax development
How to use jQuery to solve Javascript browser compatibility problems
Silverlight, Ajax components require different approach to UI
Visual Studio's IntelliSense for jQuery doesn't autocomplete correctly
Internet Explorer 8 beta's development tools add source visualizations
Microsoft PDC gives a taste of Windows 7, Visual Studio 2010
Widgetbox provides good example of how to use Facebook Developer Toolkit
VBScript Tutorial
Ajax Learning Guide
Mainsoft introduces .NET-to-Java translation tool
Ajax.NET Professional retired

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
Ajax  (SearchWinDevelopment.com)
Atlas  (SearchWinDevelopment.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Development Solutions - Silverlight, WinForms, ASP.NET
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts