You are developing an ASP.NET MVC web application for viewing a photo album. The application is designed for devices that support changes in orientation, such as tablets and smartphones. The application displays a grid of photos in portrait mode.
When the orientation changes to landscape, each tile in the grid expands to include a description. The HTML that creates the gallery interface resembles the following markup.
If this CSS is omitted, the existing CSS displays the tiles in landscape mode.
You need to update the portrait mode CSS to apply only to screens with a width less than 500 pixels.
Which code segment should you use?
Answer : D
Screen is used for computer screens, tablets, smart-phones etc.
max-width is the maximum width of the display area, such as a browser window.
References: http://www.w3schools.com/cssref/css3_pr_mediaquery.asp
Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You are developing an ASP.NET Core MVC web application. The landing page of the application contains over 100 small JPEG images, including many images that have embedded text.
Mobile device users report performance issues when loading the landing page. You debug the application and determine that the number of HTTP requests is causing the issue.
You need to improve the performance of the landing page.
Solution: Combine images into a single image and use CSS sprites.
Answer : A
You create an ASP.NET MVC application. You host the application by using the Open Web Interface for .NET (OWIN). You run the following command by using the NuGet Package Manager console:
install-package Microsoft.AspNet.SignalR
You plan to implement real-time push notifications from the server using ASP.NET SignalR.
You need to complete the ASP.NET SignalR implementation.
Which three steps should you perform? Each correct answer presents part of the solution.
Answer : A, C, D
A: In Solution Explorer, right-click the project, select Add | New Folder, and add a new folder named Hubs.
Right-click the Hubs folder, click Add | New Item, select the Visual C# | Web | SignalR node in the Installed pane, select SignalR Hub Class (v2) from the center pane, and create a new hub named ChatHub.cs. You will use this class as a SignalR server hub that sends messages to all clients.
C: Use the SignalR jQuery library in a web page to send messages and display updates from the hub.
D: Create an OWIN startup class to configure the application.
You have a class that includes the following code. (Line numbers are included for reference only.)
You must enforce the following requirements for the actions:
You need to configure the class.
Which three actions should you perform? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
You need to modify the application to meet the productId requirement.
Which code segment should you use?
Answer : C
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
The conditional expression to test.
You need to enable client-side validation for an ASP.NET MVC application.
Which three actions should you perform? Each correct answer presents part of the solution.
Answer : B, C, E
B: The validation can be implemented using jQuery and jQuery validation plug-in (jquery.validate.min.js and jquery.validate.unobtrusive.min.js).
C: When you are developing an MVC application in Visual Studio 2012 then the client-side becomes enabled by default, but you can easily enable or disable the writing of the following app setting code snippet in the web.config file.
<configuration>
</configuration>
E: The jQuery validation plug-in takes advantage of the Data Annotation attributes defined in the model, which means that you need to do very little to start using it.
Customers download videos by using HTTP clients that support various content encodings.
You need to configure caching on the DownloadVideo action to maximize performance.
Which attribute should you add?
Answer : E