AJAX interview questions part -II

13. Explain the limitations of AJAX.
The following are the limitations of AJAX:
  • It is difficult to bookmark a particular state of the application.
  • Function provided in the code-behind file do not work because the dynamic pages cannot register themselves on browsers history engine automatically.
  • If JavaScript is disabled, then AJAX is not able to perform any work.
  • Response time may be slow because different controls of a page are loaded at different time.


14. What are the differences between AJAX and JavaScript?
The differences between AJAX and JavaScript are given as follows:
  • AJAX sends request to the server and does not wait for the response. It performs other operations on the page during that time. JavaScript make a request to the server and waits for response.
  • AJAX does not require the page to refresh for downloading the whole page while JavaScript manages and controls a Web page after being downloaded.
  • AJAX minimizes the overload on the server since the script needs to request once while JavaScript posts a request that updates the script every time.


15. Explain the UpdatePanel control.
The UpdatePanel control specifies the portions of a Web page that can be updated together. As the UpdatePanel control refreshes only a selected part of the Web page instead of refreshing the entire page with a postback, you get more flexibility to create rich and client-centric Web applications.


Refreshing a selected part of the Web page is referred as partial-page update. You can add one or more UpdatePanel control in the Web page, which automatically participates in partial-page update without custom client script. The UpdatePanel control uses the UpdatePanel class to support the partial-page rendering.


16. What does the DynamicPopulateExtender control do?
The DynamicPopulateExtender control populates the contents of a control dynamically. It enables you to send an asynchronous call to the server that dynamically populates the contents of a control. The DynamicPopulateExtender control replaces the contents of a control with the result of a Web service or page method call.


17. What does the MinimumPrefixLength property of the AutoCompleteExtender control do?
The MinimumPrefixLength property sets the minimum number of characters that must be entered before getting suggestions from the Web service.


18. What is the importance of client-side libraries?
Client-side libraries contain built-in code to make asynchronous calls over XMLHTTP. These libraries automatically handle browser compatibility issues. These libraries are based on a programming model similar to ASP.NET.


19. Can we call server-side code from JavaScript?
Yes, page methods and Web services are the two techniques to call the server-side code from JavaScript.


20. What are the components of the ASP.NET AJAX architecture?
You can divide the ASP.NET AJAX architecture into two components - AJAX client architecture and AJAX server architecture.


21. Describe AJAX Control Extender Toolkit.
AJAX Control Toolkit is a set of extenders that are used to extend the functionalities of the ASP.NET controls. The extenders use a block of JavaScript code to add new and enhanced capabilities to the ASP.NET controls. AJAX Control Toolkit is a free download available on the Microsoft site. You need to install this toolkit on your system before using extenders.


22. Explain the need of the Timer control in AJAX.
The Timer control is used with an UpdatePanel control to allow partial-page updates at a specified interval. It is mostly used when a periodically partial-page update for one or more UpdatePanel controls is required without refreshing the entire page.


The Timer control is a server control that sets a JavaScript component in the Web page. The interval property of the Timer control specifies time in milliseconds. Similar to the UpdatePanel control, the Timer control also requires an instance of the ScriptManager control in the Web page.


When the Timer control initiates a postback, the Tick event is raised on the server for which you can provide an event handler to perform the actions when the page is submitted to the server. The Tick event occurs when the time specified in the interval property has elapsed and the page is posted on the server. You can add one or more Timer controls on a Web page. Usually the entire page requires only a single Timer control; however, you can use multiple Timer controls, if the UpdatePanel controls are being updated at different intervals.


23. List the different states of XMLHttpRequest with their description.
The different states of the XMLHttpRequest object are as follows:
  • Uninitialized - Refers to the state when the object has not been initialized.
  • Open - Refers to the state when the object has been created; however, the send function has not been invoked.
  • Sent -Refers to the state when the send function is invoked; however, the status and headers are not available.
  • Receiving - Refers to the state when the process is receiving data.
  • Loaded - Refers to the state when the procedure is completed and the entire data is available.


24. Can we nest the UpdatePanel controls?
Yes, we can nest the UpdatePanel control.

No comments:

Post a Comment