Web Developer Framework 4.0 Sample Questions – 32

Question: You are implementing an ASP.NET AJAX page. You add two UpdatePanel controls named pnlA and pnlB. pnlA contains an UpdatePanel control named pnlAInner in its content template. You have the following requirements.

  • Update panels pnlA and pnlB must refresh their content only when controls that they contain cause a postback.
  • Update panel pnlAInner must refresh its content when controls in either pnlA or pnlB or pnlAInner cause a postback.

You need to configure the panels to meet the requirements.
What should you do

  1. Set the UpdateMode of pnlA and pnlB to Conditional. Set the UpdateMode of pnlAInner to Always.
  2. Set the UpdateMode of pnlA and pnlB to Conditional. Set the UpdateMode of pnlAInner to Conditional, and add AsyncPostBackTrigger elements to its Triggers element for every control in pnlA.
  3. Set the UpdateMode of pnlA and pnlB to Always. Set the UpdateMode of pnlAInner to Conditional.
  4. Set the UpdateMode of pnlA and pnlB to Always. Set the UpdateMode of pnlAInner to Always, and add AsyncPostBackTrigger elements to its Triggers element for every control in pnlB.

Correct Answer: 1


Question: You have an ASP.NET Web Forms application for processing orders. Many users of the application submit their order forms multiple times due to incorrectly formatted credit card information. You need to plan for validation of the length and format of data in the credit card field on the client side prior to processing each transaction.
Which approach should you recommend

  1. Use a CustomValidator control in the Page_Load method.
  2. Use a CustomValidator control in the OnServerValidate method.
  3. Use a RequiredFieldValidator control and a CompareValidator control.
  4. Use a RequiredFieldValidator control and a RegularExpressionValidator control.

Correct Answer: 4


Question: You are implementing an ASP.NET AJAX page that contains two div elements.
You need to ensure that the content of each div element can be refreshed individually, without requiring a page refresh. What should you do

  1. Add a form, an update panel, and a script manager to the page. Add a content template to the update panel. Move the div elements into the content template.
  2. Add two forms to the page. Add a script manager and an update panel to each form. Add a content template to each update panel, and move each div element into a content template.
  3. Add a form and two update panels to the page. Add a script manager to the form. Add a content template to each update panel, and move a div element into each content template.
  4. Add a form and two update panels to the page. Add two script managers to the form, one for each update panel. Add a content template to each update panel, and move each div element into a content template.

Correct Answer: 3


Question: You are designing an ASP.NET Web application. You have the following requirements:

  • Users must be allowed to save their work in progress on one computer and to continue the work on another computer.
  • Data that is submitted for processing must be valid, and invalid data must be rejected.
  • Primary key constraints within the database must be enabled at all times.
  • The application must store only data that is entered by the user.

You need to design data validation to support the requirements.
Which two approaches should you recommend (Each correct answer presents part of the solution. Choose two.)

  1. Store temporary form data as XML in a database table.
  2. Use validators to verify the data when the user submits a form.
  3. Add an isTemporary column to each database table, and set all columns to allow null values.
  4. Provide default values for the database columns, and submit the form with user-entered values when the user saves the form.

Correct Answer: 1 & 2


Question: You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows Communication Foundation (WCF) Data Services service. You deploy the service to the following URL: http://contoso.com/Northwind.svc.
You want to query the WCF Data Services service to retrieve a list of customer objects.
You need to ensure that the query meets the following requirements:

  • Only customers that match the following filter criteria are retrieved: City=”Seattle” AND Level > 200.
  • Data is sorted in ascending order by the ContactName and Address properties.

Which URL should you use for the query

  1. http: //contoso.com/Northwind.svc/Customers City=Seattle & Level gt 200 & $orderby=ContactName,Address
  2. http: //contoso.com/Northwind.svc/Customers City=Seattle & Level gt 200 & $orderby=ContactName and Address
  3. http: //contoso.com/Northwind.svc/Customers $filter=City eq ‘Seattle’ and Level gt 200 & $orderby=ContactName,Address
  4. http: //contoso.com/Northwind.svc/Customers $filter=City eq ‘Seattle’ and Level gt 200 & $orderby=ContactName and Address

Correct Answer: 3

Tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.