BTI420 Quiz 2

Quiz 2, on Tuesday, January 27, 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.

.

When would you create a View Model?  How and where would you create it?

Any time you have to deliver data to a user.

Or when you need to get data from a user.

Create a simple C# class. Its name should suggest its usage.

For now, store it alongside the controllers (in the Controllers folder).

.

Name two kinds of members that can be added to a class. Briefly explain the purpose of one of these members.

Field – Variable with local class scope, not public

Property – Store data or state for the class. Public.

Method – Behaviour or functionality for the class. Public or private.

Constructor – Method that’s called when the object is created.

Others: Constant, Event, Indexer, Destructor, Nested type

.

Name two ways to get user input data to a controller method? Briefly discuss the functionality of one of these ways.

HTTP POST, via HTML Form submit 
The runtime builds an object (or dictionary) with the user-entered values, and passes it to the method

Query string values 
Accessed by name, Request.QueryString[name]

.

.

.

.

.

.

.

.

.

.

.

.

  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: