- MVC Framework Tutorial
- MVC Framework - Home
- MVC Framework - Introduction
- MVC Framework - Architecture
- MVC Framework - ASP.NET Forms
- MVC Framework - First Application
- MVC Framework - Folders
- MVC Framework - Models
- MVC Framework - Controllers
- MVC Framework - Views
- MVC Framework - Layouts
- MVC Framework - Routing Engine
- MVC Framework - Action Filters
- Advanced Example
- MVC Framework - Ajax Support
- MVC Framework - Bundling
- Exception Handling
- MVC Framework Useful Resources
- Questions & Answers
- MVC Framework - Quick Guide
- MVC Framework - Resources
- MVC Framework - Discussion
MVC Framework Mock Test
This section presents you various set of Mock Tests related to MVC Framework Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.
MVC Framework Mock Test IV
Q 1 - Windows Azure ACS allows for federated identification from outside agencies such as a Microsoft account or Facebook. Which entity issues the final token that your application will accept for access?
Answer : D
Explanation
D.ACS reads the token provided by the identity providers and creates a token that your application understands and accepts.
Q 2 - WIF enables you to create a custom token. To be able to use the token, you must create a custom token handler by overriding which of the following?
Answer : B
Explanation
B.SecurityTokenHandler is the appropriate class to override for creating a custom token handler
Q 3 - WIF adds the concepts of claims to which of the following? (Choose all that apply.)
Answer : E
Explanation
E.The class implementing the IIdentity interface contains claims information. The class implementing the IPrincipal interface contains claims information.
Q 4 - What class handles the actual data encryption?
Answer : C
Explanation
C.CryptoStream provides access to an encrypted stream
Q 5 - What are digital signatures used for? (Choose all that apply.)
Answer : F
Explanation
F.Authentication is a reason for digital signing because it uniquely defines the party signing the data. Non-repudiation is a reason for digital signing because it uniquely defines the party signing the data and shows that it had to be the original party that submitted the data.Authorization can be determined after the individual is uniquely defined.
Q 6 - How do you encrypt the <connectionStrings> section of the Web.config file?
B - aspnet_regiis -pe "Web.Config"-app "/MachineDPAPI" -prov "RsaProtectedConfigurationProvider"
D - aspnet_regiis -pd "Web.Config" -app "/MachineDPAPI" -prov "RsaProtectedConfigurationProvider"
Answer : A
Explanation
A.This is the proper way to encrypt the <connectionStrings> setting of the Web.config file
Q 7 - What roles does a CA play in a PKI? (Choose all that apply.)
A - Serves the certificate for the web server
B - Validates the company or individual purchasing the certificate
C - Signs the certificate as authentic
D - Provides the Domain Name System (DNS) connections between the client and server
Answer : E
Explanation
E.The CA validates the company or individual.The CA signs the certificate
Q 8 - What are the primary differences between the AntiXSS Library and the default .NET Framework? (Choose all that apply.)
B - The AntiXSS Library has be modified to realize performance gains.
D - The AntiXSS Library offers enhanced globalization capabilities.
Answer : E
Explanation
E.The AntiXSS Library is more performant than the traditional .NET Framework.AntiXSS takes an accepted-list approach, which means only those characters that have been approved are allowed through.AntiXSS was designed to allow additional support for globalization.
Q 9 - A SQL injection attack occurs when an application allows input submitted by the client to be run as part of a SQL command. What actions should a developer take to ensure that this doesn't happen? (Choose all that apply.)
A - Use Entity SQL because it does not suffer from the same risk.
B - Use SQLParameters to submit the parameters.
C - Use Linq-to-Entities to access the database,
Answer : E
Explanation
E.Using SQLParameters is the best way to manage this risk.Linq-to-Entities uses an object model as access into the data layer, so the risk is mitigated.
Q 10 - If you have View with @Page directive to inherit from ViewPage<TModel> then your View is_________.(where TModel is type of Model)
Answer : B
Explanation
B.Strongly typed views are bound to the model
Q 11 - You are writing an action method called AddProduct inside the Product controller. The logic in your code indicates that you need to call the Cart controller's Add method as a result of your controller's action method. Which line of code would accomplish this?
A - return Content("Cart.Add")
B - Response.Redirect("Cart.aspx?Add")
Answer : C
Explanation
C.This will redirect to the Add method of Cart controller
Q 12 - You are implementing an ASP.NET MVC 2 Web application. The URL with path /Home/Details/{country} will return a page that provides information about the named country. You need to ensure that requests for this URL that contains an unrecognized country value will not be processed by the Details action of HomeController.What should you do?
A - Add the ValidateAntiForgeryToken attribute to the Details action method.
Answer : C
Explanation
C.IrouteConstraint interface is implemented to configure default route to implement custom logic
Q 13 - You create an ASP.NET MVC 2 Web application that contains the following controller class.public class CartController : Controller { static List products = new List(); public ActionResult Index() { return View(); }}and the Views folder of your application, you add a view page named Index.aspx that includes the following @ Page directive.<%@ Page Inherits="System.Web.Mvc.ViewPage" %> You test the application with a browser. You receive the following error message when the Index method is invoked: "The view 'Index' or its master was not found." You need to resolve the error so that the new view is displayed when the Index method is invoked.What should you do?
A - Create a folder named Cart inside the Views folder.Move Index.aspx to the Cart folder.
Answer : A
Explanation
A.Create a folder named Cart inside the Views folder.Move Index.aspx to the Cart folder.
Q 14 - You are developing an ASP.NET MVC 2 application. A view contains a form that allows users to submit their first name. You need to display the value that is submitted, and you must ensure that your code avoids crosssite scripting. Which code segment should you use?
A - <% Response.Write(HttpUtility.HtmlDecode(Model.FirstName)) %>
Answer : B
Explanation
B.<%: Model.FirstName %> avoids cross site scripting
Q 15 - Which of the following statement is false about MVC in .NET?
A - Complete control over your HTML Markup
B - Makes Test Driven Development (TDD) very difficult
C - Allows you to create SEO-friendly URLs for your site
Answer : B
Explanation
B.Makes Test Driven Development (TDD) very difficult
Q 16 - The Controller class is responsible for the following processing stages:
A - Locating the appropriate action method to call and validating that it can be called.
B - Getting the values to use as the action method's arguments.
C - Handling all errors that might occur during the execution of the action method.
Answer : D
Explanation
D.All of the above.
Q 17 - Which Helper Method is used to return a user-defined content type.
Answer : A
Explanation
A.Content Helper Method is used to return a user-defined content type.
Q 18 - Which Helper Method Returns binary output to write to the response?
Answer : B
Explanation
B.File Helper Method Returns binary output to write to the response
Q 19 - Which Action Result Renders a partial view, which defines a section of a view that can be rendered inside another view?
Answer : C
Explanation
C.PartialViewResult
Q 20 - what is strongly typed view in mvc
A - view created with model class
B - view having same name as class
C - view created with strong keyword
Answer : A
Explanation
A.Strongly typed views are created with model class
Q 21 - what are partialviews in mvc?
A - Its the resource file for a view
B - View that has strongly-type models
Answer : D
Explanation
D.Partial views in mvc are the reusable views
Q 22 - Whichtools is used for unit testing in MVC
Answer : A
Explanation
A.MOQ are used to perform unit testing in MVC.
Q 23 - Where are routes registered in ASP.NET MVC Application?
Answer : C
Explanation
C.Routes are configured in Global.ascx in mvc
Q 24 - Which of the following represents razor syntax?
Answer : B
Explanation
B.Razar syntax starts with @
Q 25 - . How to return the JSON from action method in ASP.Net MVC?
Answer : A
Explanation
A.JSON are used to return JSON result in MVC
Answer Sheet
Question Number | Answer Key |
---|---|
1 | D |
2 | B |
3 | E |
4 | C |
5 | F |
6 | A |
7 | E |
8 | E |
9 | E |
10 | B |
11 | C |
12 | C |
13 | A |
14 | B |
15 | B |
16 | D |
17 | A |
18 | B |
19 | C |
20 | A |
21 | D |
22 | A |
23 | C |
24 | B |
25 | A |
To Continue Learning Please Login
Login with Google