Murach Quiz 1

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

What is the following code called? @{Layout = null;} a.A Razor code block b.A Razor expression c.A Razor view Xd.A Razor layout

a.A Razor code block

What does the following code use to display the description that's stored in the ViewBag? <p>Description: @ViewBag.Description</p> a.A Razor view b.A Razor layout c.A Razor code block d.A Razor expression

a.A Razor expression

What is a jumbotron? a.A large grey box with rounded corners and a large font b.A navigation bar that collapses in smaller viewports c.A dismissable context message area. d.A simple button with rounded corners

a.A large grey box with rounded corners and a large font

Which of the following statements about Visual Studio Code is true? a.It is a code editor that works well for ASP.NET Core MVC development. b.It has more features than Visual Studio. c.It is an IDE that works well for ASP.NET Core MVC development. d.It only runs on Windows.

a.It is a code editor that works well for ASP.NET Core MVC development.

What is the name of the tool that you can use to manage the client-side libraries for a Visual Studio project? a.LibMan b.NuGet c.Bootstrap d.jQuery

a.LibMan

Code Example 2-1 public class HomeController : Controller { public IActionResult Index() { ViewBag.Description = "Gibson Les Paul"; ViewBag.Price = 699.99; return View(); }} Refer to Code Example 2-1. Which file stores the view that's displayed by the Index() method? a.Views/Index.cshtml b.Home/Index/View.cshtml c.Views/Index/Home.cshtml d.Views/Home/Index.cshtml

a.Views/Home/Index.cshtml

When a responsive navigation bar collapses in a smaller viewport, what does it typically display on its right side? a.a toggler button b.a nav item c.a badge d.nothing

a.a toggler button

The only software component that's required to run a web application on a client is a.a web browser b.a database server c.a web server d.an application server

a.a web browser

The Bootstrap grid system provides all but one of the following classes. Which one is it? a.cell b.container c.row d.col-size-count

a.cell

Within a <form> element, which of the following classes would you use to format an <input> element? a.form-control b.control-group c.form-group d.control-form

a.form-control

In a controller, which of the following statements checks whether the data in the model is valid? a.if (ModelState.IsValid) {...} Xb.if (Validate(model)) {...} Xc.if (model.IsValid) {...} Xd.if (ModelData.IsValid()) {...}

a.if (ModelState.IsValid) {...}

Unlike a static web page, a dynamic web page a.is generated by a web app that's running on an application server b.can't be displayed in a web browser c.consists of HTML d.is created in response to an HTTP request

a.is generated by a web app that's running on an application server

A Razor view start a.lets you specify the default Razor layout b.provides a way to store CSS formatting for multiple pages in a single file c.provides a way to store HTML elements for multiple pages in a single file d.provides a way to store HTML elements that are unique to a web page

a.lets you specify the default Razor layout

A CSS style sheet a.provides a way to store CSS formatting for multiple pages in a single file b.lets you specify the default Razor layout c.provides a way to store HTML elements for multiple pages in a single file d.provides a way to store HTML elements that are unique to a web page

a.provides a way to store CSS formatting for multiple pages in a single file

Once a browser makes a request and receives a response a.the app terminates and its state is lost Xb.the app continues running to keep track of state Xc.the app keeps a connection to the browser open to maintain state Xd.the app stores the state in a cache so it can retrieve it later

a.the app terminates and its state is lost

In an MVC web app, the controller consists of a.the code that receives requests from users b.the code that provides the data access c.the code that generates the user interface d.the code that provides the business logic

a.the code that receives requests from users

How do you code an action method that handles an HTTP POST request but not an HTTP GET request? a.Inherit the PostController class b.Code the HttpPost attribute above the action method c.Use the Startup.cs file to configure the middleware for HTTP POST requests d.Pass the model object to the View() method

b.Code the HttpPost attribute above the action method

In a view, which of the following tag helpers displays a summary of all validation errors that are stored in the model? Xa.asp-action="All" b.asp-validation-summary="All" c.asp-action="ValidationSummary" d.asp-validation-summary="ModelState"

b.asp-validation-summary="All"

In an ASP.NET Core MVC app, coding by convention a.is not enabled by default b.reduces the amount of configuration that developers need to do if they follow certain conventions c.configures the HTTP request and response pipeline d.identifies which services to use and provides additional configuration if necessary

b.reduces the amount of configuration that developers need to do if they follow certain conventions

In an MVC web app, the view consists of a.the code that provides the business logic b.the code that generates the user interface c.the code that receives requests from users d.the code that provides the data access

b.the code that generates the user interface

Which of the following lists the names of six folders that are included in an MVC web app by convention? a.wwwroot, Model, View, Controller, Home, Temp b.wwwroot, Controllers, Models, Views, Home, Shared c.Root, Controllers, Models, Views, Home, Shared d.wwwroot, HomeController, HomeModel, Views, Home, Shared

b.wwwroot, Controllers, Models, Views, Home, Shared

What is the maximum number of columns that a row can contain when you use the Bootstrap grid system? a.6 b.8 c.12 d.It depends on the screen size

c.12

Which of the following is a programming model for web development that's built on an open-source platform and can run on multiple operating systems? Xa.ASP.NET Web Forms Xb.ASP.NET Open c.ASP.NET Core MVC Xd.ASP.NET MVC

c.ASP.NET Core MVC

A controller is a a.Razor file that handles HTTP requests b.Razor file that defines the data for an app c.C# class that inherits the Controller class d.regular C# class that defines the data for an app

c.C# class that inherits the Controller class

In the Startup.cs file, which method contains the code that configures the HTTP request and response pipeline? a.View() Xb.ConfigureServices() c.Configure() d.Index()

c.Configure()

The protocol that's used by a web browser and a web server to communicate in a web app is a.DBMS b.IIS c.HTTP d.HTML

c.HTTP

Compared to Web Forms, which of the following is NOT a benefit of the MVC pattern? a.It makes the app easier to maintain. b.It makes it easier to have different members of a team work on different components. c.It makes it easier to set up the app and get started quickly. Xd.It makes it possible to automate testing of individual components.

c.It makes it easier to set up the app and get started quickly.

If the following is coded above a property in a model class, what does it do? [Range(1, 10, ErrorMessage = "Please enter a number between 1 and 10.")] a.It uses the default error message if the property isn't within the specified range. b.It prevents the code from compiling. c.It specifies a user-friendly error message if the property isn't within the specified range. d.It binds the property to an HTML element in the view.

c.It specifies a user-friendly error message if the property isn't within the specified range.

Which of the following is an attribute that's used to validate data? a.asp-for b.HttpGet c.Required d.ModelState

c.Required

Which of the following statements about ASP.NET Core middleware components is false? a.They can edit the content of a response. b.They can short circuit a request. c.They must be configured the same for all web apps. d.They are configured in the Startup.cs file.

c.They must be configured the same for all web apps.

If you want the Bootstrap table classes to work properly with an HTML table, the table must include a.a thead element b.a tbody element c.both thead and tbody elements d.none of the above

c.both thead and tbody elements

Which of the following class attributes formats the element as a button with a solid background and light text? Xa.class="btn-primary" b.class="btn btn-primary-solid" c.class="btn btn-primary" d.class="btn btn-primary-outline"

c.class="btn btn-primary"

Which of the following class attributes would increase the margin on the right side of the element by .5 rem? a.class="m-.5" b.class="m-2" c.class="mr-2" d.class="mr-.5"

c.class="mr-2"

Which of the following class attributes would increase the padding on all sides of an element? a.class="pad-3" b.class="padall-3" c.class="p-3" Xd.class="pa-3"

c.class="p-3"

Which of the following classes would you use to cause an image to be sized based on the size of its containing element? a.img-scale Xb.img-scale-container c.img-fluid Xd.img-fluid-container

c.img-fluid

A Razor layout a.lets you specify the default Razor layout b.provides a way to store HTML elements that are unique to a web page c.provides a way to store HTML elements for multiple pages in a single file d.provides a way to store CSS formatting for multiple pages in a single file

c.provides a way to store HTML elements for multiple pages in a single file

When a dynamic web page is requested, the web server passes the request to a.the browser b.the operating system c.the application server d.the database server

c.the application server

You can create a strongly-typed view by using the @model directive to specify a model type and by using the asp-for tag helper to bind HTML elements to Xa.the actions of the controller Xb.the actions of the model object c.the properties of the model object Xd.the properties of the controller

c.the properties of the model object

Which part of the following URL identifies the domain name for the website? https://www.murach.com/products/index.html a.index.html b.https c.www.murach.com d.products

c.www.murach.com

Which of the following statements is true? a..NET Core supports Web Forms development. Xb..NET Core only runs on Windows. Xc..NET Framework supports ASP.NET Core MVC development. d..NET Framework only runs on Windows.

d..NET Framework only runs on Windows.

Which of the following elements uses Font Awesome to display an icon? Xa.<span class="badge badge-primary"> Xb.<span class="icon icon-primary"> Xc.<span class="icon icon-primary-cart"> d.<span class="fas fa-shopping-cart">

d.<span class="fas fa-shopping-cart">

Which of the following statements describes the Internet? a.It consists of many WANs. b.It is often referred to as "the Cloud". c.It can be accessed through an ISP. d.All of the above.

d.All of the above.

Code Example 2-1 public class HomeController : Controller { public IActionResult Index() { ViewBag.Description = "Gibson Les Paul"; ViewBag.Price = 699.99; return View(); } } Which one of the following is an action of the HomeController class? Xa.ViewBag Xb.IActionResult c.View() d.Index()

d.Index()

Code Example 2-1 public class HomeController : Controller { public IActionResult Index() { ViewBag.Description = "Gibson Les Paul"; ViewBag.Price = 699.99; return View(); }} Refer to Code Example 2-1. Which one of the following is a property of the HomeController class? Xa.View() Xb.Controller Xc.Index() d.ViewBag

d.ViewBag

When you use Visual Studio to start a project, you can generate some starting folders and files for an ASP.NET Core MVC web app by selecting a template named a.Empty b.Web Application c.API d.Web Application (Model-View-Controller)

d.Web Application (Model-View-Controller)

When you use the CSS classes of the Bootstrap grid system, you can specify the number of columns that an element spans Xa.for the most common screen size Xb.for the smallest screen size c.for the largest screen size d.for each screen size

d.for each screen size

A model is a a.Razor file that handles HTTP requests Xb.C# class that inherits the Model class c.Razor file that defines the data for an app d.regular C# class that stores the data for an app

d.regular C# class that stores the data for an app

An intranet a.is a local area network (LAN) b.connects computers that are near each other c.consists of many wide area networks (WANs) d.All of the above e.A and B only

e.A and B only

If the following code is in a Razor view imports file, what does it do? @using GuitarShop.Models@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers a.It makes it easier to use the model classes in the GuitarShop namespace. b.It makes it easier to use the tag helpers that are available from ASP.NET Core MVC. c.It helps views display more quickly when they start. d.All of the above e.A and B only

e.A and B only

Which of the following classes would you use on a div element that contains a label and a control? a.form-control b.form-horizontal c.form-group d.row

form-group


Ensembles d'études connexes

Smartbook Recharge Chapter 14 ACCT 405

View Set

State Regulation and Principals Checkpoint Quiz

View Set

Web Development Chapter 6 Review

View Set

Biological Rhythms (EPM & EZ + Circadian Rhythms)

View Set