70-494 Recertification for MCSD: Web Applications

Page 1   
Question 1

You need to update the routes to ensure that a product is always displayed on the product
page.
Which code segment should you use?


  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D


Answer : B

Question 2

When users attempt to retrieve a product from the product page, a run-time exception
occurs if the product does not exist.
You need to route the exception to the CustomException.aspx page.
Which method should you add to MvcApplication?


  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D


Answer : B

Question 3

You need to add a method to the ProductController class to meet the exception handling
requirements for logging.
Which code segment should you use?


  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D


Answer : A

Question 4

You need to configure session storage in the web.config file to meet the technical
requirements for scalability.
Which SessionState mode should you use? (Each correct answer presents a complete
solution. Choose all that apply.)

  • A. StateServer
  • B. InProc
  • C. AutoDetect
  • D. SqlServer


Answer : A,D

Question 5

You need to ensure that new customers enter a valid email address.
Which code should you use? (Each correct answer presents part of the solution. Choose all
that apply.)


  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D


Answer : A,D

Question 6

You need to implement the mobile device support requirements.
How should you build the ProcessRequest method? (To answer, select the appropriate
options in the answer area.)





Answer :

Question 7

You need to modify the application to meet the productId requirement.
What should you do?

  • A. Modify the RegisterGlobalFilters method of the Global.asax.cs file as follows. Contract.Assume<ArgumentException>(productId != 0);
  • B. Modify the GetDealPrice method of ProductController as follows. Contract.Requires<ArgumentException>(productId > 0);
  • C. Modify the RegisterGlobalFilters method of the Global.asax.cs file as follows. Contract.Requires<ArgumentException>(productId > 0);
  • D. Modify the GetDealPrice method of ProductController as follows. Contract.Assume<ArgumentException>(productId > 0);


Answer : B

Explanation: The Contract.Requires(Of TException) method specifies a precondition contract for the enclosing method or property, and throws an exception if the condition for the contract fails. Syntax: 'Declaration Public Shared Sub Requires(Of TException As Exception) ( _ condition As Boolean _) Type Parameters TException The exception to throw if the condition is false. Parameters condition Type: System.Boolean The conditional expression to test. Reference: Contract.Requires(Of TException) Method (Boolean)

Question 8

You need to implement the business requirements for managing customer data.
What should you do? (Each correct answer presents part of the solution. Choose all that
apply.)

  • A. Add a class named Customer-Controller to the Controllers folder. Then add a method named Edit to the class.
  • B. Create a new controller named Administration in the Controllers folder. Add an action named EditCustomer to the controller.
  • C. Add a folder named Customer to the Views folder. Then create a view inside this folder named Edit.aspx.
  • D. Create a new folder named EditCustomer to the Views folder. In the new folder, create a new file named Administration.aspx.


Answer : A,B

Question 9

You updated the web.config file with the HTTP run-time value required to display an
alternative version of the site.
You need to ensure that the correct page displays to the users.
Which code segment should you use to update the controller?

  • A. If (Request.IsTabletDevice)
  • B. If (Request.Browser.IsBrowser("Mobile"))
  • C. If (Request.UserAgent["Tablet"])
  • D. If (Request.Browser.IsMobileDevice)


Answer : D

Question 10

You need to implement the requirements for handling IIS errors.
What should you do?


  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D


Answer : A

Question 11

The GetDealPrice method must be called by using Ajax.
You need to get the price of a product by using the GetDealPrice method of the
ProductController.
Which code segment should you use? (Each correct answer presents a complete solution.
Choose all that apply.)


  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D


Answer : C,D

Question 12

You need to implement client-side animations according to the business requirements.
Which line of code should you use? (Each correct answer presents a complete solution.
Choose all that apply.)

  • A. $ ("h1: first") .animate ({ opacity: 0 });
  • B. $("h1:first").fadeIn(1000);
  • C. $("h1:first").animate({ opacity: 1 });
  • D. $("h1:first").fadeOut(1000);


Answer : A,D

Question 13

You need to modify the application to meet the productId requirement.
Which code segment should you use?


  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D


Answer : C

Explanation: Scenario: The value of the productId property must always be greater than 0. Note: The Contract.Requires(Of TException) method specifies a precondition contract for the enclosing method or property, and throws an exception if the condition for the contract fails. Syntax: 'Declaration Public Shared Sub Requires(Of TException As Exception) ( _ condition As Boolean _) Type Parameters TException The exception to throw if the condition is false. Parameters condition Type: System.Boolean The conditional expression to test. Reference: Contract.Requires(Of TException) Method (Boolean)

Question 14

An advertising campaign was recently launched. Some of the ads contain a link to products
that no longer exist or have IDs that have changed.
You need to ensure that all product links display a product.
Which code segment should you use to configure the route?


  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D


Answer : A

Question 15

You are designing a Windows Communication Foundation (WCF) service that uses the
Product class.
You need to update the class to meet the storage requirement.
What should you do? (Each correct answer presents part of the solution. Choose all that
apply.)

  • A. Mark the Product class with the DataContract attribute.
  • B. Mark the public members of the Product class with the DataContractFormat attribute.
  • C. Mark the Product class with the CollectionDataContract attribute.
  • D. Mark the public members of the Product class with the DataMember attribute.


Answer : A,D

Explanation: So as of .NET 3.5 SP1, you don't have to add data contract or data member attributes anymore - if you don't then the data contract serializer will serialize all public properties on your class, just like the XML serializer would. HOWEVER: by not adding those attributes, you lose a lot of useful capabilities: ✑ without [DataContract], you cannot define an XML namespace for your data to live in ✑ without [DataMember], you cannot serialize non-public properties or fields ✑ without [DataMember], you cannot define an order of serialization (Order=) and the DCS will serialize all properties alphabetically ✑ without [DataMember], you cannot define a different name for your property (Name=) ✑ without [DataMember], you cannot define things like IsRequired= or other useful attributes ✑ without [DataMember], you cannot leave out certain public properties - all public properties will be serialized by the DCS Topic 3, Video Transcoding Service Background You are developing a video transcoding service. This service is used by customers to upload video files, convert video to other formats, and view the converted files. This service is used by customers all over the world. Business Requirements The user-facing portion of the application is an ASP.NET MVC application. It provides an interface for administrators to upload video and schedule transcoding. It also enables administrators and users to download the transcoded videos. When videos are uploaded, they are populated with metadata used to identify the video. The video metadata is gathered by only one system when the video upload is complete. Customers require support for Microsoft Internet Explorer 7 and later. The application contains a header that is visible on every page. If the logged-on user is an administrator, then the header will contain links to administrative functions. This information is read from a cookie that is set on the server. The administrative links must not be present if an error condition is p

Page 1