Tinfo 431 Chapter 1-6 Quiz

55 Questions | Attempts: 36
Share
SettingsSettings
Please wait...
  • 1/55 Questions

    The default project generated by Visual Studio gives you 2 Controllers by default:

    • ContactController
    • HomeController
    • AboutController
    • AccountController
Please wait...
About This Quiz

55 questions 55 minutes.

Computer Quizzes & Trivia

Quiz Preview

  • 2. 

    The generated Visual Studio default web site gives you the functionality of all the following pages:

    • Home page

    • Contact page

    • Account login

    • Account logout

    • Site map page

    • Unhandled error page

    • About page

    • Account registration

    Correct Answer(s)
    A. Home page
    A. Contact page
    A. Account login
    A. Account logout
    A. Unhandled error page
    A. About page
    A. Account registration
  • 3. 

    The default behavior of the HomeController is to take requests for index, about, or contact pages and return a:

    • Response object

    • Redirect URL

    • View

    • Model

    Correct Answer
    A. View
  • 4. 

    The MVC framework can use a Controller to put text in the browser as a response to a request, without using either a Model or a View.

    • True. Controllers can do this on their own.

    • False. Behind the scenes, a Model and a View are being invoked. Controllers don't do anything by themselves.

    Correct Answer
    A. True. Controllers can do this on their own.
  • 5. 

    MVC Views are part of a templating system which can dynamically replace tags in front end html code withvalues from the application.

    • True. Views are fed data from the interaction with the Model and the Controller.

    • False. Views are a traditional user interface component.

    Correct Answer
    A. True. Views are fed data from the interaction with the Model and the Controller.
  • 6. 

    An MVC View will render its data to the user:

    • Simply by pointing a browser at the View's address.

    • When instructed to do so by a Controller, and (usually) after getting data to display from a Model.

    Correct Answer
    A. When instructed to do so by a Controller, and (usually) after getting data to display from a Model.
  • 7. 

    Strongly typed Views have all of the following benefits except:

    • Allow you to set a Model class type for a View

    • IntelliSense help from Visual Studio

    • Allows ViewBag to efficiently deal with large quantities of data

    • Compiler is checking the syntax of your code

    Correct Answer
    A. Allows ViewBag to efficiently deal with large quantities of data
  • 8. 

    Not as robust as strongly typed View(s), but often used to pass smaller amounts of data from the Controller to a View to be rendered.

    • GridBag

    • ViewBag

    • ViewData

    • MVC

    Correct Answer
    A. ViewBag
  • 9. 

    In the following code fragment from a View cshtml file, the "@" symbol is:

    • Telling the user that what follows is an email domain name.

    • Telling the Razor view engine that what follows is code, not HTML text.

    • Telling the browser that what follows is a return to normal HTML

    • Telling the browser to interpret what follows as JavaScript.

    Correct Answer
    A. Telling the Razor view engine that what follows is code, not HTML text.
  • 10. 

    To override the behavior described above, if you wanted to return the View, /Views/Home/NotIndex.cshtml youwould code:

    • Return View("/Home/NotIndex.cshtml");

    • Return View("NotIndex");

    • Return "/Home/NotIndex.cshtml";

    • Return new View("NotIndex");

    Correct Answer
    A. Return View("NotIndex");
  • 11. 

    Models are implemented in:

    • Cshtml files (as partial classes)

    • JavaScript files (as JavaScript classes)

    • C# (.cs) files (as C# classes)

    • XAML files

    Correct Answer
    A. C# (.cs) files (as C# classes)
  • 12. 

    The EF uses a special table to help keep updated on changes between the code-first models and the database schema. In current MVC 5 this is:

    • EdmMetaData table

    • __MigrationHistory

    • EntityFramework

    • Model-Controller sync tool

    Correct Answer
    A. __MigrationHistory
  • 13. 

    HTML helpers address all of the following web site code challenges except:

    • Methods you can invoke on the Html property in a View

    • Make sure that URLs point to the correct locations

    • Inject data values into your HTML using the Razor tags

    • HTML form elements have the correct names and values for model binding

    Correct Answer
    A. Inject data values into your HTML using the Razor tags
  • 14. 

    Many helpers, such as the TextArea Helper output values that are HTML encoded. This is to help mitigate what kind of attacks?

    • SQL injection

    • Phishing

    • Cross-site scripting

    • Buffer overflow

    • DHCP starvation attack

    Correct Answer
    A. Cross-site scripting
  • 15. 

    If you type: '@Html.' and after typing the dot, the IntelliSense popup window shows a method name with a small down arrow to the left of the name, it means that the method is what kind?

    • Regular instance method

    • Expansion method

    • One of the HtmlHelper built-in extension methods

    • Public override method

    Correct Answer
    A. One of the HtmlHelper built-in extension methods
  • 16. 

    The validation support in MVC includes which of the following (select all that apply):

    • Client side validation

    • Server side validation

    • Handling of user interface issues associated with display of error messages

    • Providing some mechanism for users to recover from validation failures

    • Database normalization

    Correct Answer(s)
    A. Client side validation
    A. Server side validation
    A. Handling of user interface issues associated with display of error messages
    A. Providing some mechanism for users to recover from validation failures
  • 17. 

    Multiple Validation Annotations can be applied to a C# property by simply listing them above the property one on top of the next. For example:

    • True

    • False

    Correct Answer
    A. True
  • 18. 

    Which MVC component represents a set of classes that describe the business logic of the application?

    • Model

    • View

    • Controller

    • CLR

    Correct Answer
    A. Model
  • 19. 

    The HttpUtility.HtmlEncode utility method (select all that apply):

    • Provide the correct URL link from a friendly search string

    • Prevents users from injecting JavaScript code or HTML markup into the view for malicious reasons.

    • Can only be used with a GET, not a POST

    • Works only on HTML, not on the JavaScript, there is a separate scrubber for JS.

    Correct Answer
    A. Prevents users from injecting JavaScript code or HTML markup into the view for malicious reasons.
  • 20. 

    Which MVC component represents a set of classes that describe the business logic of the application?

    • Model

    • View

    • Controller

    • CLR

    Correct Answer
    A. Model
  • 21. 

    Models in an MVC application are the objects you want to (choose all that apply):

    • Display (send to a view)

    • Save

    • Create

    • Update

    • Delete

    • Perform business calculations

    Correct Answer(s)
    A. Display (send to a view)
    A. Save
    A. Create
    A. Update
    A. Delete
    A. Perform business calculations
  • 22. 

    So far in this course, we have focused on the scaffolding for which:

    • MVC 5 Controller with read/write Actions

    • MVC 5 Controller with Views, Using Entity Framework

    • Web API 2 API Controller Scaffolders

    • MVC 5 Controller - Empty

    Correct Answer
    A. MVC 5 Controller with Views, Using Entity Framework
  • 23. 

    MVC framework gives you access to the following helpers except:

    • URL helpers (via the Url property)

    • Ajax helpers (via the Ajax property)

    • URL helper from within the controller

    • JSon helper from the data store

    Correct Answer
    A. JSon helper from the data store
  • 24. 

    The entire internet world of online commerce would crumble tomorrow if the form tag went away (according to one author of the book) because without it you would not be able to search for anything or execute a transaction on a server.

    • True

    • False

    Correct Answer
    A. True
  • 25. 

    This line of code is an example of using Routes.GetVirtualPath(), which will pull in all the routes you application has registered. These are located in which file?

    • Startup.cs

    • Global.asax

    • Bootstrap.css

    • RouteConfig.cs

    Correct Answer
    A. Global.asax
  • 26. 

    MVC Views have Helpers for more than just the HTML property. There are Helpers for which of the following View properties?

    • HTML

    • JavaScript

    • Ajax

    • URL

    • C# auto-implemented property

    Correct Answer(s)
    A. HTML
    A. Ajax
    A. URL
  • 27. 

    From the standpoint of ASP.NET MVC, validation is all of the following except:

    • Client validation on a web site that can give a user instant feedback on the information they enter into a form

    • A feature that is more or less expected in today's web applications

    • Server validation logic is in place because your application should never trust information arriving from the network.

    • Validation of what is already in the database

    Correct Answer
    A. Validation of what is already in the database
  • 28. 

    Validation in the MVC design pattern context deals mostly with validating against:

    • Models

    • Views

    • Controller logic

    • All of the above

    Correct Answer
    A. Models
  • 29. 

    Many MVC validation annotations include an option for a custom error message to be displayed.

    • True

    • False

    Correct Answer
    A. False
  • 30. 

    If the built-in validation annotations do not fit your scenario, you can custom code your own validations. To do this you would extend the class:

    • AttributeValidate

    • ValidateAttribute

    • ValidationAttribute

    • PleaseCheckMyValue

    Correct Answer
    A. ValidationAttribute
  • 31. 

    Self-validating models can be created by implementing which interface?

    • IModelValidation

    • IValidateObject

    • IValidatableObject

    • ICheckEmForErrors

    Correct Answer
    A. IValidatableObject
  • 32. 

    Model classes are typical C# data object classes with (select all that apply):

    • Public properties

    • Get operations

    • Set operations

    • Instance variable storage

    • Auto-implemented properties

    • Utility methods such as print, ToString, etc.

    Correct Answer(s)
    A. Public properties
    A. Get operations
    A. Set operations
    A. Instance variable storage
    A. Auto-implemented properties
  • 33. 

    Which MVC component group receives the request from the application's user and deals with event handling?

    • Model

    • View

    • Controller

    • CLR

    Correct Answer
    A. Controller
  • 34. 

    The de facto standard wizard setting selections for creating an ASP.NET MVC web application include all the following except:

    • A separate project for unit testing.

    • Individual user accounts for authentication.

    • Hosting the application in a Windows Azure cloud account.

    • Integration of Web Forms and Web API code along with MVC.

    Correct Answer(s)
    A. A separate project for unit testing.
    A. Individual user accounts for authentication.
  • 35. 

    The default Views in an MVC project will supply you with 3 subdirectories of cshtml files, named:

    • File

    • Account

    • About

    • Home

    • Contact

    • Shared

    Correct Answer(s)
    A. Account
    A. Home
    A. Shared
  • 36. 

    When a controller action has the code "return View();" this is taking advantage of an implicit convention in the MVC framework that:

    • Doesn't have to specify the View's folder because each action method has a folder and is called through the MVC routing mechanism.

    • Doesn't have to specify the View's filename because each controller folder contains a view file named for each action method.

    • It is returning View because these simple examples are handling everything within the controller, there is no View.

    • It is returning a new View object that is empty.

    Correct Answer
    A. Doesn't have to specify the View's filename because each controller folder contains a view file named for each action method.
  • 37. 

    In a strongly typed view, setting a model type for a view, you can use which C# using statement in place of thefully qualified type name @ model IEnumerable<MvcMusicStore.Models.Album>?

    • @using MvcMusicStore.Models.Album

    • @using MvcMusicStore.Models.*;

    • @using MvcMusicStore.Models

    • @using IEnumerable

    Correct Answer
    A. @using MvcMusicStore.Models
  • 38. 

    When you create a View from the dialog, you can choose from some scaffold templates. MVC has which of the following?

    • Create

    • Delete

    • Search

    • Details

    • Edit

    • Empty (with or without a Model)

    • List

    Correct Answer(s)
    A. Create
    A. Delete
    A. Details
    A. Edit
    A. Empty (with or without a Model)
    A. List
  • 39. 

    What advantages are there to Model binding? (select all that apply)

    • Makes it easier to pull all fields from a model based on various different data types of the properties in the model

    • Can search through the query string, route data, or the form collection to find values that need binding.

    • Can automatically detect a security concern of an over-posting attack by not binding an unexpected value

    Correct Answer(s)
    A. Makes it easier to pull all fields from a model based on various different data types of the properties in the model
    A. Can search through the query string, route data, or the form collection to find values that need binding.
  • 40. 

    Scaffolding can do all of the following (select all that applies):

    • Examine the Model definition and generate a Controller

    • Generate the generated Controller's associated Views

    • Generate boilerplate for CRUD operations in the app

    • Generate the business rule logic that your application addresses, such as selling flowers, etc.

    Correct Answer(s)
    A. Examine the Model definition and generate a Controller
    A. Generate the generated Controller's associated Views
    A. Generate boilerplate for CRUD operations in the app
  • 41. 

    Why is it important for MVC programmers to cover the HTML Form tag in such depth (select all that apply):

    • Without the Form tag, the internet would be a read-only repos of documentation (Web 1.0)

    • MVC uses the form tag to create an HTTP GET request.

    • Using the form tag keeps web developers in sync with the intended utilization of GET and POST.

    • ASP.NET supports the form tag in the use of Web Forms, but developers coming from that background will have additional support mechanisms to learn for MVC.

    • MVC uses the form tag to create an HTTP POST request.

    Correct Answer(s)
    A. Without the Form tag, the internet would be a read-only repos of documentation (Web 1.0)
    A. MVC uses the form tag to create an HTTP GET request.
    A. Using the form tag keeps web developers in sync with the intended utilization of GET and POST.
    A. ASP.NET supports the form tag in the use of Web Forms, but developers coming from that background will have additional support mechanisms to learn for MVC.
  • 42. 

    The Entity Framework supports the following approaches (select all that apply):

    • Database-first

    • Model-first

    • View-first

    • Code-first

    • Controller-first

    Correct Answer(s)
    A. Database-first
    A. Model-first
    A. Code-first

Quiz Review Timeline (Updated): Mar 22, 2022 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 22, 2022
    Quiz Edited by
    ProProfs Editorial Team
  • Jan 21, 2017
    Quiz Created by
    Dsurge13
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.