مشخصات کتاب
-
Rob Conery
-
2009
-
انگلیسی
-
413
-
57
-
0
Professional ASP.NET MVC 1.0
دوره آموزش MVC
Chapter 1: NerdDinner 1
File ➪ New Project 5
Examining the NerdDinner Directory Structure 7
Running the NerdDinner Application 9
Testing the NerdDinner Application 12
Creating the Database 13
Creating a New SQL Server Express Database 14
Creating Tables within Our Database 15
Setting Up a Foreign Key Relationship Between Tables 18
Adding Data to Our Tables 20
Building the Model 20
LINQ to SQL 21
Adding LINQ to SQL Classes to Our Project 21
Creating Data Model Classes with LINQ to SQL 22
NerdDinnerDataContext Class 25
Creating a DinnerRepository Class 26
Retrieving, Updating, Inserting, and Deleting Using the DinnerRepository Class 28
Integrating Validation and Business Rule Logic with Model Classes 30
Controllers and Views 34
Adding a DinnersController Controller 35
Adding Index and Details Action Methods to the DinnersController Class 36
Understanding ASP.NET MVC Routing 37
Using the DinnerRepository from Our DinnersController 39
Using Views with Our Controller 40
Implementing the “NotFound” View Template 42
Implementing the “Details” View Template 44
Implementing the “Index” View Template 49
Convention-Based Naming and the \Views Directory Structure 54
Create, Update, Delete Form Scenarios 56
URLs Handled by DinnersController 56
Implementing the HTTP-GET Edit Action Method 57
Html.BeginForm and Html.TextBox Html Helper Methods 61
Implementing the HTTP-POST Edit Action Method 62
Handling Edit Errors 66
Understanding ModelState and the Validation HTML Helper Methods 68
Using a AddRuleViolations Helper Method 70
Complete Edit Action Method Implementations 71
Implementing the HTTP-GET Create Action Method 72
Implementing the HTTP-POST Create Action Method 74
Implementing the HTTP-GET Delete Action Method 78
Implementing the HTTP-POST Delete Action Method 80
Model Binding Security 82
CRUD Wrap-Up 83
ViewData and ViewModel 86
Passing Data from Controllers to View Templates 86
Using the ViewData Dictionary 87
Using a ViewModel Pattern 89
Custom-Shaped ViewModel Classes 92
Partials and Master Pages 92
Revisiting Our Edit and Create View Templates 92
Using Partial View Templates 93
Using Partial View Templates to Clarify Code 97
Master Pages 98
Paging Support 101
Index() Action Method Recap 102
Understanding IQueryable<T> 102
Adding a “page” Value to the URL 103
Adding Page Navigation UI 106
Authentication and Authorization 110
Understanding Authentication and Authorization 110
Forms Authentication and the AccountController 111
Authorizing the /Dinners/Create URL Using the [Authorize] Filter 114
Using the User.Identity.Name Property When Creating Dinners 116
Using the User.Identity.Name Property When Editing Dinners 116
Showing/Hiding Edit and Delete Links 118
AJAX Enabling RSVPs Accepts 119
Indicating Whether the User Is RSVP’ed 120
Implementing the Register Action Method 122
Calling the Register Action Method Using AJAX 123
Adding a jQuery Animation 125
Cleanup — Refactor out a RSVP Partial View 127
Integrating an AJAX Map 127
Creating a Map Partial View 127
Creating a Map.js Utility Library 129
Integrating the Map with Create and Edit Forms 131