Working with ASP.NET AJAX - Placement questions
Q.1 What are the advantages of AJAX
A) AJAX is a platform-independent technology.
B) It provides partial-page updates.
C) Improved performance.
D) All of the above.
View Answer / Hide AnswerANSWER: D
Explanation:
Asynchronous JavaScript and XML (AJAX) is a platform-independent technology. It enables you to perform partial-page rendering by using UpdatePanel control. You get increased performance and scale by processing portions of a page on the client.
Q.2 Which control is required of every AJAX page to manage the JavaScript files sent to the client and the communication between client and server?
A) UpdatePanel
B) ScriptManager
C) AsyncPostBackTrigger
D) None of the above.
View Answer / Hide AnswerANSWER: B
Explanation:
ScriptManager control is mandatory control if you want to work with ASP.NET AJAX server control. Only one instance of a ScriptManager can be added to the web page. It manages the JavaScript files sent to the client and the communication between the server and the client. It also manages partial-page updates. The HTML for a ScriptManager control in Source view looks as follows:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
</asp:UpdatePanel>
Q.3 Which control can be used to update only the portion of the page?
A) UpdatePanel
B) ScriptManager
C) AsyncPostBackTrigger
D) None of the above.
View Answer / Hide AnswerANSWER: A
Explanation:
The UpdatePanel control allows you define areas of a page that should PostBack to the server independent of the rest of the page. It is used to update only the portion of the page and the user does not see a full-screen refresh. The UpdatePanel control works as a container for other controls.
Q.4 A button control is located outside the UpdatePanel control. You need that a given button control outside of the UpdatePanel should cause the UpdatePanel to execute an update with partial update. What will you do to achieve this task?
A)
- Add a PostBackTrigger control to the Triggers section of the UpdatePanel.
- Set the ControlID attribute of the AsyncPostBackTrigger control to the ID of the Button control.
B)
- Add a Trigger control to the Triggers section of the UpdatePanel.
- Set the ControlID attribute of the AsyncPostBackTrigger control to the ID of the Button control.
C)
- Add an AsyncPostBackTrigger control to the Triggers section of the UpdatePanel.
- Set the ControlID attribute of the AsyncPostBackTrigger control to the ID of the Button control.
D) None of the above.
View Answer / Hide AnswerQ. 5 A Master Page contains a ScriptManager control and a user wants the AJAX functionality on content page then which control is necessary on content page.
A) AsyncPostBackTrigger
B) ScriptManager
C) ScriptManagerProxy
D) None of the above.
View Answer / Hide AnswerQ.6 The UpdatePanel supports two types of triggers: AsyncPostBackTrigger and PostBackTrigger. Choose the correct option regarding working of these triggers.
A) AsyncPostBackTrigger causes an asynchronous (Ajax) postback.
B) PostBackTrigger causes a normal entire-page postback.
C) AsyncPostBackTrigger causes a normal entire-page postback.
D) Option A and B are Correct.
View Answer / Hide AnswerQ.7 Match the correct code:
a. UpdatePanel --------------- i. If Master Page contains a ScriptManager then content page will use this control.
b. UpdateProgress ------------ ii. ContentTemplate
c. Timer --------------------- iii. ProgressTemplate
d. ScriptManagerProxy -------- iv. Tick Event
Codes:
(A) a - iii b - ii c - iv d - i
(B) a - ii b - iii c - iv d - i
(C) a - i b - ii c - iv d - iii
(D) a - i b - ii c - iii d - iv
View Answer / Hide AnswerQ.8 How many ScriptManager control can be added on a ASP.NET web page?
A) Only One
B) More than One
C) Only Two
D) None of the above.
View Answer / Hide AnswerQ.9 You are writing a page that contains an UpdatePanel for partial-page updates. You want that user should get the message “Processing is going on, please wait.” that the update is processing only if the update takes longer than 5 seconds. Which actions should you take?
A) Add a ProgressBar control to the page. Set the Interval property to 5000. Set the text property as “Processing is going on, please wait.”
B) Add a Timer control to the page. Set the Interval property to 5000. Set its text property to Processing is going on, please wait.”
C) Add an UpdateProgress control to the UpdatePanel. Set its DisplayAfter property to 5000. Set its ProgressTemplate contents to read “Processing is going on, please wait.”
D) None of the above.
View Answer / Hide AnswerANSWER: C
Explanation:
The UpdateProgress control provides status information about partial-page updates in UpdatePanel controls.An UpdateProgress control is used to display text or graphics. The DisplayAfter attribute provides facility that how long the page waits from the start of the request until it displays the progress indicator. According to given above example If the request returns during this time (within 5 seconds), the progress indicator is not shown.
Q.10 What property and method of the Page object do you use to register client script dynamically from code?
A) ScriptManager control is used to dynamically register client script from code.
B) The Page.ClientScript.RegisterClientScriptBlock is used to dynamically register client script from code.
C) ScriptManagerProxy control is used to dynamically register client script from code.
D) None of the above.
View Answer / Hide Answer