AJAX Interview Questions



What Is ASP.NET 2.0 AJAX?

On June 28, 2005, Microsoft announced “ASP.NET 2.0 AJAX.” ASP.NET 2.0 AJAX is an AJAX-oriented .NET library that runs on .NET 2.0. Though ASP.NET 2.0 AJAX is an AJAX library and can be used to perform AJAX operations, it is really much more. ASP.NET 2.0 AJAX offers many of the same types of features of the server-side ASP.NET, but it is directed at the client side. Because ASP.NET 2.0 AJAX is fully integrated with ASP.NET, it provides rich integration with the services provided by ASP.NET.

ASP.NET 2.0 AJAX provides the following features (and much more):

AJAX-style communications between client and server. This communication is over web services.
Asynchronous communication. All client-to-server communication in the ASP.NET 2.0 AJAX framework is asynchronous.
A set of server-side controls that enable rich client-side functionality.
A set of client-side controls and classes that further enable client-side functionality.
A framework for encapsulating client-logic through the creation of namespaces and classes.
Cross browser support. Although there is no official matrix of web browsers that ASP.NET 2.0 AJAX supports, the latest versions of Internet Explorer, Firefox, and Safari are supported. In addition, Opera is thought to be supported; however, we have not been able to find an official statement from Microsoft regarding this.


Running ASP.NET AJAX Applications

Unfortunately, not all web browsers ever produced will support ASP.NET AJAX. To run an ASP.NET AJAX application, a web browser must:

Be relatively modern — ASP.NET AJAX applications are not available in all versions of all web browsers. Though Internet Explorer version 6 and later, Firefox version 1.5 and later, and Safari provide support for these applications, older versions may be problematic because of their support for different versions of the other requirements.

Support the DOM — The capability to update form elements on a page based on new data is important. Accessing the controls in a standard way means that writing code that runs over a majority of web browsers is easier than having code that has a large number of if/then/else statements that are dependent on the browser version.

Support JavaScript — ASP.NET AJAX requires some amount of actions to occur out on the client. These actions are done using the JavaScript programming language. Because the major web browsers support JavaScript, it makes sense for JavaScript to be used for the client-side programming language.

Possibly have ActiveX enabled on the client — If you are using the Internet Explorer 6 browser while running on Windows, you may have problems if ActiveX is not enabled.
Who’s Using AJAX?

Great, now that you have seen that there is this technology called AJAX, are you alone in not having seen or talked about this before? Absolutely not! AJAX has just recently taken off in the second half of 2005 from a mindshare standpoint. As discussions have gone on with counterparts in the development community, many developers are just now looking to what AJAX can do for their applications and ultimately their customers. So, just who is using AJAX publicly?

Google Suggest—Google Suggest features a dynamic drop-down list box that provides possible items to search on along with the approximate number of search results.

Google Maps — The ability to grab a map and zoom around without requiring a postback is just amazing. This app/service took the development world by storm when it came out.

Google Gmail — Google Gmail is a web-based email system.

Live.com — The local.live.com service from Microsoft is actively using the ASP.NET AJAX framework, as is nearly the entire Live.com service. Hotmail, the email service for Live.com, has updated its service and uses AJAX.

Outlook web access — The web interface into Microsoft Exchange 2000 was one of the early AJAX applications.

Easy Search Component — The ASP.NET Easy Search Component provides support for searching a single web site similar to the Google Suggest service.

Other component vendors — Component vendors such as ComponentArt, Dart, and others are providing controls that provide a rich user experience without forcing a full postback.

To go along with the third-party interest, the amount of developer interest is tremendous. For example, one only has to put the word AJAX into a blog title to receive an increase in the number of web views. Based on the amount of third-party support and the interest of developers, it is only a matter of time before everyone is doing it.

At this time, the first version of the ASP.NET 2.0 AJAX framework is an add-on to the existing .NET 2.0. It runs on top of the framework with no changes to the underlying “bits.”

ASP.NET 2.0 AJAX falls into four areas:

Server-side controls — Server-side controls generate the appropriate client-side markup and script to perform client-side operations without the need for a postback. These controls provide a fairly easy environment to debug. For example, debugging with the UpdatePanel is fairly easy. Besides the UpdatePanel, other controls that work similarly are the ASP.NET AJAX Control Toolkit.
Client-side classes — These classes provide additional functionality to the client-side browser. This type of functionality is similar in concept to the base class libraries included in the .NET framework. An example would be the whole Sys.Net namespace along with the extensions to the base JavaScript objects.
Web services integration — This functionality allows a developer to use web services as the communication channel between the web browser and the web server without having to understand the differences between the MSXML component in IE and the XmlHttpRequest object in Firefox.


Qus:- What is the disadvantage of AJAX?

Ans

Data is stored at the client side so crucial and confidential data should not be stored to avoid any kind of security issues. For example it will be wrong to find password on client machine in html code.

Ajax  - What is the disadvantage of AJAX? - March 11, 2009 at 19:00 pm by Rajmeet Ghai

What is the disadvantage of AJAX?

The disadvantages of AJAX are:

Search engines would not be able to index an AJAX application.
The server information can not be accessed within AJAX.
AJAX is not well integrated with any browser.
ActiveX requests are enabled only in IE 5 and IE6
Data of all requests is URL-encoded, which increases the size of the request.


Que:-  What are the benefits of AJAX over Java applet?

Ans:- 

Html based web applications are easily searchable & can be indexed.
Startup time to load a applets is more that loading a page with ajax.
Applets provides a different look and feel than a normal web based application

What are the benefits of AJAX over Java applet?

The following are the benefits of AJAX over Java applet:

AJAX applications are loaded in seconds, where as Applets takes longer time. The reason is, Applet applications are tend to load large libraries.
AJAX provides standard look and feel for web applications, where as Applets provides GUI based look and feel.
AJAX features can increase from a conventional web application, where as Applets uses complete programming process right from the scratch.
Java version changes enable incompatibilities between Applet and java environments used by the browser, where as in AJAX incompatibilities are not the constraints.


Qus:- What is AJAX and what problem does it solve?

Answer

Ajax is a set of client side technologies that allows asynchronous communication between client and web server. In synchronous communication, complete round trip happens with each request/response action event when small data of the page to be refreshed. Ajax has solved this problem of posting entire information every time through asynchronous communication.

XmlHttpRequest is the basic fundamental behind Ajax. This allows browser to communicate with server without making post backs.


Qus:- How is encoding handled in AJAX?

Ans

AJAX encoding can be done in two ways:

encodeActionURL() method is used for full page refresh
encodeResourceURL() method is used for partial page refresh.

1 comment: