HTML and CSS Reference
In-Depth Information
Table 7-3. Database Tables Used by the Survey Application
Table Name
Contains the survey questions. Every question has a unique QuestionID .
Contains the answer choices for the survey questions. One question can have multiple
choices. Every choice has a unique ChoiceID .
Stores the survey answers as filled in by users.
Contains user information such as FirstName , LastName , and Email .
The actual data access happens via an Entity Framework data model, shown in Figure 7-7.
Figure 7-7. Entity Framework data model for SurveyDb database tables
To access the data residing in the SurveyDb database from the client side, you use jQuery code that
calls certain action methods. In all three action methods of the controller ( HomeController ) are called from
the jQuery code. They are GetQuestions() , GetChoices() , and SaveResults() . These action methods are
discussed when they're used by the jQuery code.
When the view is loaded in the browser, a list of all the questions and their choices is displayed in the
browser. This task is accomplished in the jQuery ready() method. ready() also wires event handlers for the
buttons and the text boxes, as shown in Listing 7-6.
Listing 7-6. ready() Event Handler
var storage = window.localStorage;
$(document).ready(function () {
Search WWH ::

Custom Search