Q1. - (Topic 4)
You are developing an ASP.NET MVC application that supports multiple cultures and multiple languages. The application will be sold to international customers.
The ASP.NET MVC application must store localized content in satellite assemblies for multiple languages.
You need to generate the satellite assemblies during an automated build.
Which tool should you use?
A. Gacutil.exe
B. Al.exe
C. Ildasm.exe
D. nasm.exe
Answer: B
Explanation: Use the Assembly Linker (Al.exe) to compile .resources files into satellite assemblies. Al.exe creates an assembly from the .resources files that you specify. By definition, satellite assemblies can only contain resources. They cannot contain any executable code.
The following Al.exe command creates a satellite assembly for the application MyApp from the file strings.de.resources.
al /t:lib /embed:strings.de.resources /culture:de /out:MyApp.resources.dll
Q2. - (Topic 1)
You need to extend the edit functionality of RunLogController. Which code segment should you use?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: C
Q3. - (Topic 4)
You are developing an ASP.NET MVC application that uses forms authentication. The
application uses SQL queries that display customer order data.
Logs show there have been several malicious attacks against the servers.
You need to prevent all SQL injection attacks from malicious users against the application.
How should you secure the queries?
A. Check the input against patterns seen in the logs and other records.
B. Escape single quotes and apostrophes on all string-based input parameters.
C. Implement parameterization of all input strings.
D. Filter out prohibited words in the input submitted by the users.
Answer: C
Explanation: SQL Injection Prevention, Defense Option 1: Prepared Statements (Parameterized Queries) The use of prepared statements (aka parameterized queries) is how all developers should first be taught how to write database queries. They are simple to write, and easier to understand than dynamic queries. Parameterized queries force the developer to first define all the SQL code, and then pass in each parameter to the query later. This coding style allows the database to distinguish between code and data, regardless of what user input is supplied.
Prepared statements ensure that an attacker is not able to change the intent of a query, even if SQL commands are inserted by an attacker.
Reference: SQL Injection Prevention Cheat Sheet
Q4. - (Topic 4)
You are developing an ASP.NET MVC application that will run on Azure.
The application uses Event Tracing for Windows (ETW) for logging operations.
You need to retrieve the ETW data for the application from a deployed Azure instance by using the Azure Diagnostics API.
Which data source should you use?
A. Azure Diagnostic infrastructure logs
B. Windows event logs
C. performance counters
D. .NET EventSource
Answer: D
Explanation: Azure Diagnostics 1.2 and 1.3 are Azure extensions that enable you to
collect diagnostic telemetry data from a worker role, web role, or virtual machine running in
Azure.
Diagnostics 1.2 and 1.3 enable the collection of ETW and .NET EventSource events.
Example:
EtwProviders>
<EtwEventSourceProviderConfiguration provider="SampleEventSourceWriter"
scheduledTransferPeriod="PT5M">
<Event id="1" eventDestination="EnumsTable"/>
<Event id="2" eventDestination="MessageTable"/>
<Event id="3" eventDestination="SetOtherTable"/>
<Event id="4" eventDestination="HighFreqTable"/>
<DefaultEvents eventDestination="DefaultTable" />
</EtwEventSourceProviderConfiguration>
</EtwProviders>
Reference: Enabling Diagnostics in Azure Cloud Services and Virtual Machines
https://azure.microsoft.com/sv-se/documentation/articles/cloud-services-dotnet-diagnostics/
Q5. DRAG DROP - (Topic 4)
You are developing an ASP.NET MVC application in Visual Studio 2012. The application will be viewed with browsers on desktop devices and mobile devices. The application uses the Razor View Engine to display data.
The application contains two layouts located in the /Views/Shared directory.
These layouts are named:
. _Layout.cshmtl
. _MobleLayoutcshtml
The application must detect if the user is browsing from a mobile device. If the user is browsing from a mobile device, the application must use the _MobileLayout.cshtml file. If the user is browsing from a desktop device, the application must use .Layout, cs html.
You need to ensure that the application renders the layout that is appropriate for the browser.
You have the following code:
Which code segments should you include in Target 1, Target 2 and Target 3 to complete the code of the ViewStart.cshtml file? (To answer, drag the appropriate code segments to the correct targets. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)
Answer:
Q6. HOTSPOT - (Topic 1)
You need to ensure that only valid parameters are passed to the EditLog action.
How should you build the route? (To answer, select the appropriate options in the answer area.)
Answer:
Q7. - (Topic 4)
You are developing an ASP.NET MVC application in Visual Studio 2012. The application supports multiple cultures.
The application contains three resource files in the Resources directory:
My Dictionary.resx
MyDictionary.es.resx
MyDictionary.fr.resx
Each file contains a public resource named Title with localized translation.
The application is configured to set the culture based on the client browser settings.
The application contains a controller with the action defined in the following code segment. (Line numbers are included for reference only.)
You need to set ViewBag.Title to the localized title contained in the resource files.
Which code segment should you add to the action at line 03?
A. ViewBag.Title = HttpContext.GetGlobalResourceObuect("MyDictionary", "Title");
B. ViewBag.Title = HttpContext.GetGlobalResourceObject("MyDictionary", "Title", new System.Globalization.CultureInfo("en"));
C. ViewBag.Title = Resources.MyDictionary.Title;
D. ViewBag.Title = HttpContext.GetLocalResourceObject("MyDictionary", "Title");
Answer: C
Q8. - (Topic 1)
You need to display the "miles" unit description after the distance in the GetLog view.
Which line of code should you use to replace line GL21? (Each correct answer presents a complete solution. Choose all that apply.)
A. @log.Distance miles
B. @Htrml.DisplayFor(model => log.Distance) miles
C. @log.Distance.ToString() @Html.TextArea("miles")
D. @Html.DisplayFor(model => log.Distance.ToString() + " miles")
Answer: A,B
Q9. HOTSPOT - (Topic 4)
You are developing an ASP.NET MVC web application that enables users to open Microsoft Excel files.
The current implementation of the ExcelResult class is as follows.
You need to enable users to open Excel files. You have the following code:
Which code segments should you include in Target 1, Target 2 and Target 3 to implement the ExecuteResult method? To answer, select the appropriate option or options in the answer area.
Answer:
Q10. - (Topic 4)
You are developing an ASP.NET MVC application.
The application must allow users to enter JavaScript in a feedback text box only.
You need to disable request validation.
What should you do?
A. Apply and set the CausesClientSideValidation attribute on the text box to FALSE.
B. Apply and set the ValidateInput attribute on the text box to FALSE.
C. Use the HttpRequest.Unvalidated property to read the unvalidated form value.
D. Use the HttpRequest.Form property to read the unvalidated form value.
Answer: C
Explanation: Provides access to HTTP request values without triggering request validation.
http://msdn.microsoft.com/en-us/library/system.web.httprequest.unvalidated.aspx
Q11. DRAG DROP - (Topic 4)
You are developing an ASP.NET MVC application in a web farm. The application has a page that uploads a customer's photo, resizes it, and then redirects the browser to a page where the new image is displayed along with the final dimensions.
The final dimensions should be available only to the page where the new image is displayed.
You need to store state and configure the application.
What should you do? (To answer, drag the appropriate item to the correct location. Each item may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)
Answer:
Q12. DRAG DROP - (Topic 4)
You are developing an ASP.NET MVC application in a web farm. The application has a page that accepts a customer’s order, processes it, and then redirects the browser to a page where the order is displayed along with the shipping information.
The order information should be available only to the page where the order is displayed.
You need to store state and configure the application.
What should you do? To answer, drag the appropriate item to the correct location. Each item may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
Answer:
Q13. DRAG DROP - (Topic 4)
You are developing an ASP.NET MVC application in Visual Studio.
The application contains an area that is defined as shown in the following graphic.
The ActionLink method must invoke the GetOrders() action in ExternalOrderController.
You need to configure the parameters of the ActionLink method.
You have the following markup.
Which markup segments should you include in Target 1, Target 2 and Target 3 to complete the markup? To answer, drag the appropriate markup segment to the correct targets. Each markup segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
Answer:
Q14. - (Topic 4)
You are developing an ASP.NET MVC application that uses forms authentication. The user database contains a user named LibraryAdmin.
You have the following requirements:
. You must allow all users to access the GetBook method.
. You must restrict access to the EditBook method to the user named LibraryAdmin.
You need to implement the controller to meet the requirements.
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: A,C
Q15. DRAG DROP - (Topic 3)
You need to ensure that the transcode.exe utility is installed before the worker role starts.
How should you implement the startup task? (To answer, drag the appropriate values to the correct element or attribute. Each value may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)
Answer:
Q16. HOTSPOT - (Topic 4)
You are developing an ASP.NET MVC application in Visual Studio 2012. The application supports multiple cultures.
To set the culture, the application must use the AcceptLanguage header field value sent by the client browser.
You need to ensure that the application can set the culture. You have the following markup in the web.config file:
Which markup segments should you include in Target 1, Target 2 and Target 3 to complete the markup? (To answer, select the appropriate options in the answer area.)
Answer: