BTI420 Quiz 5

Quiz 5, on Tuesday, February 17, 2015

.

The sample answers are just that – sample answers. It is not necessary to include all items in a sample answer in order to earn partial or full credit.

.

Name and briefly describe the purpose of one of the data annotations (other than “Required”) that can be used in a view model class.

The notes from February 10 has coverage 
So does the textbook, Chapter 6

Required – user must provide a value 
StringLength – limits the string length; min and max 
Range – numeric upper and lower range boundaries 
Display – user-friendly string on <label> and related elements 
DataType – affects <input> fields to constrain the data entered 
RegularExpression – custom format for user input 
Compare – compares values in two elements 
HiddenInput – not visible, but included in the HTML Form elements

.

Briefly discuss a strategy for displaying associated objects in a ‘list’ view or a ‘details’ view.

This works for a single object, and for a collection of objects

View model class must include a suitable property to hold the associated object(s) 
Obviously, AutoMapper support must be there 
The Manager method (that fetches the object(s)) must use the Include() method

.

When an error happens in your web app, you may see a ‘yellow screen of death’ page, or a generic unformatted error page. How can you begin to solve this, so that a user-friendly page is displayed?

Documented fully in the “Handle request errors…” document

Add an ‘errors’ controller 
Add views for typical errors (e.g. ‘not found’ and ‘server error’) 
Add methods to the MvcApplication class to handle errors

.

.

.

.

.

.

.

.

.

.

.

.

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: