Which are limitations of AJAX?- Back functionality can’t work because the dynamic pages won’t register themselves to the browsers cache. Hence the use Iframe will become required.
- The page cannot be bookmarked if it is developed using Ajax.
- If java script is not enabled, Ajax will stop working.
- Because different components of the pages are loaded at different times, response time may be slow.
- Because different components of the pages are loaded at different times it may create confusion for the user.
What is the difference between synchronous postback and asynchronous postback?The difference between synchronous and asynchronous postback is as follows:
- Asynchronous postback renders only the part of the page which is needed; while, synchronous postback renders the entire page in a postback.
- Asynchronous postback executes only one postback at a time, that is, if you have two buttons doing asynchronous postback, the actions are executed one by one; while, - synchronous postback invoke all the actions at a time.
- Asynchronous postback only changes the update panel that invoke the postback; while, synchronous postback changes the entire page.
- AJAX applications use the XMLHttpRequest object to avoid the postback of entire page when the browser is communicating with server.
- The XMLHttpRequest object enables a client-side script to execute an HTTP request.
- For this functionality MSXML ActiveX component is used in earlier version of Internet Explorer. While, XMLHttpRequest is used in Internet Explorer 7 and other browsers, such as Mozilla, Firefox.
What are the new features included in the Microsoft AJAX library?The new features included in the Microsoft AJAX library are as follows:
- Imperative syntax: AJAX library provide simple imperative syntax which is required to create and manage controls.
- Script loader: It is used to retrieve all scripts automatically which are required by one or more client component or control and executes them in the order in which they are received.
- Client data access: It’s used to access client data and display by client data control and client template.
- Client datacontext: It’s used to read and write the permission to data in a database.
- The AdoNetDataContext class - Supports to easily communicate to an ADO.NET Data Services service.
What are the new features of ASP.NET AJAX 4.0?These features are as follows:
- It enables the application to bind the live data.
- It enables to render the client-side template.
- It enables declarative instantiation of client components.
- It provides the facility to invoke ADO.NET data services and data contexts.
- It supports for the DataView control.
How many validation controls are supported in ASP.NET AJAX 4.0?The following validation controls are supported in ASP.NET AJAX 4.0:
- FilteredTextBoxExtender : This validation is used to apply filtering to a text box.
- MaskedEditExtender and MaskedEditValidator : These validation controls are used to prevent a user to enter only a particular pattern of characters in the TextBox.
- ValidatorCalloutExtender : This validation is used to display a balloon tooltip containing the error message by attaching the ASP.NET validators.
- NoBot : It restricts the input forms automatically to be filled by spam/bot and used to ensure that the user is not a computer machine by the automated Public Turing test.
- PasswordStrengthExtender : It is used to find the strength of the password entered in the text box by checking the different strength related parameters.
- AJAX sends request to the server and will not wait for the response.
List the different states of XMLHttpRequest with their description.The different states of the XMLHttpRequest object are as follows:
1) Uninitialized : It is the state in which the object has not been initialized.
2) Open: It is the state when the object has been created but the send function is not invoked.
3) Sent: It is the state when the send function is invoked but the status and headers are not available.
4) Receiving: It is the state when the data is received by the process.
5) Loaded: It is the state when the procedure is completed and the data is available.
Describe the AccordionExtender control.- The AccordionExtender control is almost same as the CollapsiblePanelExtender control.
- It enables the grouping of multiple collapsible panels in a single control.
- It also manages the collapsed and expanded state of every panel and one panel will expand at a time.
- Using AccordionExtender control we can’t expand two or more panels at a time.
However, we can click the header templates of particular panel to display the hidden contents.
By default, one panel is always expanded in theAccordionExtender.
How do I provide internationalized AJAX interactions?To provide internationalized AJAX components you need to do the following:
Set the charset of a page to an encoding which is provided by the target languages. The following meta declaration in your HTML/JSP page is used to set the content type:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
In the server side component set the character encoding using the HttpServletRequest.setCharacterEncoding() method. Before accessing the localized parameter with HttpServletRequest.getParameter() call. In the case of UTF this will be request.setCharactherEncoding("UTF-8");.
A server-side component returning AJAX responses requires to set the encoding of the response to the similar encoding used in the page.
response.getWriter().write(" <response>Not valid </response>");