What is an Ajax
- Ajax stands for Asynchronous javascript and xml which is used for building better,faster and more interactive Web application.
- It is also used to exchange the data with server and updating the parts of web page without refreshing the whole page.
- It uses XMLHttpRequest object to interact with web server,
What are the triggers available in Update Panel
- There are two types of triggers in Update panel.
- Postback Trigger:It works with full postback means whole page will be processed
- Asyncpostback trigger:In this only portions of web page will be processed instead of processing the whole page.
What are Synchronous and Asynchronous Requests
- Both Synchronous and Asynchronous process the requests and gets the response back from the server.
- In case of Asynchronous process it will send the request to server and it will not wait for server response.It will continue further process.
- .But in case of Synchronous process client will send the request to server and will wait until the server sends the response back to client.
How to control the duration of an Ajax request
- AsyncpostbackTimeout is the property of Scriptmanager to specify the duration for Ajax Request.
- Default value is 90 Seconds.
Example:<asp:scriptmanager runat="server" id="scmgr1" AsyncpostbackTimeout ="120"/>
What is an Update Panel in Ajax
- Ajax Update Panel allows us to avoid the full postback of the page and allows only partial page postbacks.
- Ajax Update Panel consists of two child tags ContentTemplate and Triggers.
- ContentTemplate is used to hold the content of the page.It means if we design a page with some controls then those controls need to be wrapped(placed) inside a contentTemplate.
- Triggers are used to refresh the whole page or the portions of the page based on the trigger we choose.
What are the difference between Ajax and the Javascript
Ajax
|
Javascript
|
| Ajax sends the request to server and does not wait for the response | Javascript sends a request to server and waits for the response from the server. |
| Ajax minimise the overload on the server | Javascript increases the load on the server |
How can you find out that an Ajax request ahs been completed
- Readystate property is used to check whether Ajax request has been completed or not.If Readyproperty is eqyal to Four then the request has been completed.
How can we cancel the XMLHTTPRequest in Ajax
- Abort() Method can be used to cancel the XMLHTTPRequest in Ajax,
What is a ScriptManager in Ajax
- ScriptManager allows us to load Ajax related objects on the page.
- It loads Ajax related scripts and libraries.
- It provides an access to web services.
- It also allows us to enable the feature of partial rendering of a web page.
What are different Readystates in XMLHTTPRequest
- 0 - Ajax request not initialized
- 1- Ajax request server connection established
- 2-Ajax request received
- 3- Ajax request Processing
- 4- Request finished and response is ready
What is the use of XMLHTTPRequest in Ajax
- The XmlHttpRequest object is the Key to Ajax.It is an API that can be used by Javascript,Jscript,VBScript and other web browser scripting languages to transfer and manipulate xml data using HTTP,establishing a connection channel between client side and server side.
- Few of XmlHttpRequest methods are Abort,Open and Send.
- Few of XmlHttpRequest properties are Readystate,Status and onReadystatechange.
How to detect Asynchronous Partial page postbacks
- IsInAsyncpostback is the property of scriptmanager to check whether it is Asynchronous postback or not.It returns a boolean value.
In which assembly Scriptmanager class is defined
- It is defined in system.web.extensions.dll which is available in GAC.
What is the use of UpdateMode of an UpdatePanel
- If we are working with Updatepanel then we make use of UpdateMode.
- If Updatemode is set to Conditional then the content present inside the updatepanel will not get updated every time when any event is raised.
- If updatemode is set to Always then the content present inside the updatepanel will get refreshed on every postback.It means if we set updatemode to Always then if any event occurs like Button click,dropdown selectedindexchanged events occurs then the content with in the updatepanel is refreshed.Therefore it causes the page performance as the content is refreshing every time.So we need to avoid and make use of Updatemode property to Conditional
What is Scriptmanagerproxy in Ajax
- ScriptmanagerProxy enables nested components to add scripts and service references if a page already contains a scriptmanager control.
- If a master page already had a one instance of Scriptmanager and we are referring the master page in content page(.aspx page) then we cannot make use of scriptmanager in content page.In such cases we make use of Scriptmanagerproxy which works same as a Scriptmanager.
No comments:
Post a Comment