Content by Category
.NET 1.x
.NET 2.0
.NET 3.0
.NET 3.5
.NET 4.0
.NET Assemblies
.NET Framework
.NET Getting Started
Accessibility
ADO.NET
Advertorials
Agile Development
AJAX
Architecture
ASP.NET
ASP.NET MVC
ASP.NET WebForms
Azure
B2B (Business Integration)
Bing
BizTalk
Book Excerpts
Build and Deploy
C#
C++
ClickOnce
Cloud Computing
Code Contracts
CODE on the Road!
COM+
Community
Conferences
Continuous Integration
Crystal Reports
CSLA.NET
CSS
Data
Design Patterns
Development Process
Display Technologies
Distributed Computing
DotNetNuke
DSL
Dynamic Programming
Editorials
Enterprise Services ("COM+")
Entity Framework
Events
Expression Blend
F#
Fox to Fox
Frameworks
Functional Programming
Git
Graphics
Internet Explorer 8.0
Interviews
iPhone
Iron Ruby
Java
Java Script
jQuery
LINQ
Linux
Mac OS X
MDX
Microsoft Application Blocks
Microsoft Business Rules Framework
Microsoft Dynamics
Microsoft Expression
Microsoft Office
Mobile Development
Mobile PC
Mono
MsBuild
Network
NHibernate
Object Oriented Development
Open Source
Opinion
Opinions
Oracle
ORM
Other Languages
Parallel Programming
Patterns
Podcasts
Post Mortem
PowerPoint
Print/Output
Product News
Product Reviews
Project Management
Python
Q&A
Rails
Rake
Reporting Services
REST
RIA Services
Ruby
Ruby on Rails
Search
Security
Services
SharePoint
Silverlight
SOA
Social Networks
Software & Law
Software Business
Source Control
Speech-Enabled Applications
SQL Server
SQL Server 2000
SQL Server 2005
SQL Server 2008
SQL Server CE/AnyWhere/Mobile/Compact
Subversion
Sync Framework
Tablet PC
TDD
Team System
Techniques
Testing and Quality Control
Tips
UI Design
UML
User Groups
VB Script
VB.NET
Version Control
VFP and .NET
VFP and SQL Server
Virtual Earth
Vista
Visual Basic
Visual Basic 6 (and older)
Visual FoxPro
Visual Studio .NET
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010
Visual Studio Tools for Office
VSX
WCF
Web Development (general)
Web Services
WF
Whitepapers
Windows 7
Windows Azure
Windows Live
Windows Server
Windows Vista
WinForms
Workflow
WPF
XAML
XML
XNA
XSLT



DevConnections


 


DevReach

Reader rating:
Click here to read 3 comments about this article.
Article source: CoDe (2006 - Mar/Apr)


Article Pages:  1  2 3 4 5 6 - Next >


Using the Ajax.NET Framework

What developer wants to spend hours manually writing Ajax plumbing when the Ajax.NET framework does this for free? The Ajax.NET Framework presents a remarkably easy-to-use framework that will simplify Ajax development and allow developers to spend more time on implementation details and less time on parsing XML.

What Is Ajax?

If Ajax is still a new concept for you, Ajax stands for Asynchronous JavaScript and XML. Ajax groups these technologies and provides a break from the traditional model requiring a post back to the server in order to run server-side methods. Ajax allows a browser to make calls to server-side code and receive a response from the server all without using the ASP.NET postback, which transfers full ViewState and page information with each request.

How Does Ajax Work?

The “magic” of Ajax lies in the use of the HttpRequest object to facilitate communication between the browser and the server. This object will contact the server, call the designated code and wait for a response from the server. The nice part about this system is that since the processing is asynchronous, the Web browser will continue to allow the user to keep working uninterrupted with the Web application all while continuing to process on the server.

"
Even with a few extra server calls you are still sending less data across the wire than you would with traditional postbacks which often include full ViewState information.
"

A very simplistic way to think about this technology is to say that in one respect Ajax grants the user the ability to call code-behind methods from JavaScript.

Call Backs

Ajax will request a service from the server and wait for a response. The way Ajax applications wait for the response is what makes the applications useful. Once you have sent the request to the server for processing, the browser will continue to do its work. Once the server generates a response the browser will recognize that response and then continue processing.

You have two options available to you when calling code on the server in an Ajax environment. You may choose to define a callback method or you may choose to simply send a message to the server and allow the application to continue with its work without being notified the operation is complete.

If you choose to recognize the response, you will define a callback method in JavaScript. A callback method runs once the browser has recognized a response from the server. Once the callback method is invoked, the application may now conduct some additional processing of the response data as provided by the server.

Implications of N-Tiered Development

Some of the traditional lines of n-tier application architecture may blur when you use Ajax. In an application where you use Ajax but you haven’t thought through the architecture, you might have a considerable amount of overlap of business logic in the user interface layer.

You want to make sure you keep your architect’s hat on while developing Ajax applications. Remember that the business layer should know nothing of how to display information to the user and the user interface should not contain business rules. To accomplish this goal, you should strictly return data to the user interface layer and allow UI services to format the data for the final presentation. An Ajax developer may need to use an interim layer between the business objects and the browser to further prepare server-side data before rendering to the browser.

&

By: Craig Shoemaker

Craig Shoemaker is a software engineer for PDSA, Inc. (www.pdsa.com), a Microsoft Partner in Southern California. With over 10 years experience in Web development, he brings a unique perspective to tying together front- and back-end development. Craig is also the host of the Polymorphic Podcast, (www.polymorphicpodcast.com), a weekly audio show about object-oriented development, architecture, and best practices in .NET. You may reach Craig at craigs@pdsa.com.

craigs@pdsa.com

Fast Facts

The “XML” part of Ajax my be a little misleading as some methods use other technologies in place of XML for data transfer between the browser and the server. The Ajax.NET Framework uses the JSON (JavaScript Object Notation). For more information on JSON visit: http://www.crockford.com/JSON/



Article Pages:  1  2 3 4 5 6 - Next Page: 'What Is the Ajax.NET Framework?' >>

Page 1: Using the Ajax.NET Framework
Page 2: What Is the Ajax.NET Framework?
Page 3: The Task System
Page 4: Create the Entity and Collection Classes
Page 5: Implement Edit and Delete Buttons
Page 6: Implement the Task Editor Controls

How would you rate the quality of this article?
1 2 3 4 5
Poor      Outstanding

Tell us why you rated the content this way. (optional)

Average rating:
4.2 out of 5

292 people have rated this article.

      DevConnections

 

DevLink