QUESTIONYou 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.)Answer: AC

QUESTIONDrag and Drop QuestionYou are developing an ASP.NET MVC application that takes customer orders.Orders are restricted to customers with IP addresses based in the United States. You need to implement a custom route handler.How should you implement the route handler? (To answer, drag the appropriate line of code to the correct location or locations. Each line of code 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: Explanation:http://msdn.microsoft.com/en-us/library/system.web.routing.iroutehandler.gethttphandler.aspx

QUESTIONYou are designing an HTML5 website. You need to design the interface to make the content of the web page viewable in all types of browsers, including voice recognition software, screen readers, and reading pens.What should you do? (Each correct answer presents a complete solution. Choose all that apply.)

QUESTIONDrag and Drop QuestionYou are developing an ASP.NET MVC web application in Visual Studio 2012.The application has a model named ReservationLocation that contains properties named City and State. The view that displays reservations has a single text box named loc for entering the location information. The location is entered as city, state.There are action methods that have ReservationLocation as a parameter type. You need to ensure that the City and State properties are correctly populated.How should you implement model binding for the ReservationLocation type? (To answer, drag the appropriate code segment to the correct location or locations. 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:

QUESTIONYou 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.resxEach 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?

QUESTIONYou are testing an ASP.NET application. The test plan requires that tests run against the application’s business layer. You need to use the test project template that meets this requirement.Which template should you use?

QUESTIONYou are authoring unit tests. The unit tests must test code that consumes sealed classes. You need to create, maintain, and inject dependencies in the unit tests.Which isolation method should you use?

Answer: CExplanation:http://msdn.microsoft.com/en-us/library/hh549176.aspxShim types are one of two technologies that the Microsoft Fakes Framework uses to let you easily isolate components under test from the environment. Shims divert calls to specific methods to code that you write as part of your test. Many methods return different results dependent on external conditions, but a shim is under the control of your test and can return consistent results at every call. This makes your tests much easier to write.

QUESTIONYou are developing an ASP.NET MVC application by using Visual Studio.The application throws and handles exceptions when it runs.You need to examine the state of the application when exceptions are thrown.What should you do?

A. Add the following code to the web.config file of the application.<customErrors mode=”On” ><error statusCode=”404″ redirect=”CustomErrors.html” /> </customErrors>B. From the Debug menu in Visual Studio, select Exceptions. Disable the User-unhandled check box for Common Language Runtime Exceptions.C. Add the following code to the web.config file of the application.<customErrors mode=”On” ><error statusCode=”500″ redirect=”CustomErrors.html” /> </customErrors>D. From the Debug menu in Visual Studio, select Exceptions. Enable the Thrown check box for Common Language Runtime Exceptions.

Answer: DExplanation: Configuring the debugger to break for first chance exceptionsTo change when the debugger breaks, go to Debug->Exceptions…When you first open this window you will see that there is a tree grid with one column and checkboxes.* Break when Thrown. This includes a default list of exceptions known by the debugger, grouped by category.Note: The possible exceptions that could break from this list is determined by the runtime you are debugging. For example, if you are using managed-only debugging then the debugger will never break for C++, Win32 Exceptions, etc. even if they are configured to break when thrown.* Checkboxes. If you check the box for a category, then the debugger will break for all First Chance Exceptions while debugging. If you don’t want to enable all First Chance Exceptions, you can find the specific exception types that you wish to configure by using the search box.http://blogs.msdn.com/b/visualstudioalm/archive/2015/01/08/understanding-exceptions-while-debugging-with-visual-studio.aspx

QUESTIONYou are developing an ASP.NET MVC news aggregation application that will be deployed to servers on multiple networks. The application must be compatible with multiple browsers. A user can search the website for news articles.You must track the page number that the user is viewing in search results. You need to program the location for storing state information about the user’s search.What should you do?

A. Store search results and page index in Session.B. Use Application state to store search terms and page index.C. Use QueryString to store search terms and page index.D. Store search results and page index in TempData