Saturday, June 21, 2008

ScriptManager

This ScriptManager control is mandatory for every page using AJAX and every page should have only one ScriptManager control.In some cases when we use user controls that use AJAX functionalities and the calling page also uses Ajax functionalies, there will be multiple ScriptManager controls for that page and will create error.To overcome that difficulty,Microsoft gives ScriptManagerProxy control which we can use whenever we need multiple ScriptManager Controls.
Functionality of ScripyManager Control:
The ScriptManager control is central to AJAX functionality in ASP.NET. The control manages all ASP.NET AJAX resources on a page. This includes downloading Microsoft AJAX Library scripts to the browser and coordinating partial-page updates that are enabled by using UpdatePanel controls. In addition, the ScriptManager control enables you to do the following:Register script that is compatible with partial-page updates. In order to manage dependencies between your script and the core library, any script that you register is loaded after the Microsoft AJAX Library script.Specify whether release or debug scripts are sent to the browser.Provide access to Web service methods from script by registering Web services with the ScriptManager control.Provide access to ASP.NET authentication, role, and profile application services from client script by registering these services with the ScriptManager control.Enable culture-specific display of ECMAScript (JavaScript) Date, Number, and String functions in the browser.Access localization resources for embedded script files or for stand-alone script files by using the ResourceUICultures property of the ScriptReference control.Register server controls that implement the IExtenderControl or IScriptControl interfaces with the ScriptManager control so that script required by client components and behaviors is rendered.

Syntax for ScriptManager:

Syntax for ScriptManagerProxy:

Common server controls used in AJAX

The most commonly used server control used in AJAX are as follows:
1.ScriptManager
2.UpdatePanal
3.UpdateProgress
4.Timer control

Defining Ajax


Ajax isn’t a technology. It’s really several technologies, each flourishing in its own right, coming together in powerful new ways. Ajax incorporates:
standards-based presentation using XHTML and CSS;
dynamic display and interaction using the Document Object Model;
data interchange and manipulation using XML and XSLT;
asynchronous data retrieval using XMLHttpRequest;
and JavaScript binding everything together.
The classic web application model works like this: Most user actions in the interface trigger an HTTP request back to a web server. The server does some processing — retrieving data, crunching numbers, talking to various legacy systems — and then returns an HTML page to the client. It’s a model adapted from the Web’s original use as a hypertext medium, but as fans of The Elements of User Experience know, what makes the Web good for hypertext doesn’t necessarily make it good for software applications.
This approach makes a lot of technical sense, but it doesn’t make for a great user experience. While the server is doing its thing, what’s the user doing? That’s right, waiting. And at every step in a task, the user waits some more.
Obviously, if we were designing the Web from scratch for applications, we wouldn’t make users wait around. Once an interface is loaded, why should the user interaction come to a halt every time the application needs something from the server? In fact, why should the user see the application go to the server at all?

Ajax - a new approach to web applications

The domain where desktop applications beat web applications hands-down is user interaction.It is a common knowledge that all web developers used to envy the desktop application's user interface and its application speed in earlier days.But with the help of AJAX ,it has now became possible for the web developers to find a new approach for their application.By using AJAX,we can increase efficiancy,speed and good interface in the web application.
AJAX stands for asynchronus javascript and XML.It uses Javascript,XMLHttpRequest object,DOM(Document Object Model) and XMLDocument to achieve asynchronous operation in the web applications.