LaunchCode logo
  1. Contents
  2. 15. ViewModels and Model Validation

15. ViewModels and Model ValidationΒΆ

  • 15.1. ViewModels and Passing Data To and From Views
    • 15.1.1. Refactoring the View and Controller to Use a Model in a View - Video
    • 15.1.2. Refactoring the View and Controller to Use a Model in a View - Text
    • 15.1.3. Adding a ViewModel - Video
    • 15.1.4. Adding a ViewModel - Text
    • 15.1.5. Check Your Understanding
  • 15.2. Server-Side Validation
    • 15.2.1. Check Your Understanding
  • 15.3. Validation Attributes
    • 15.3.1. Common Attributes
    • 15.3.2. Defining Validation Messages
    • 15.3.3. Applying Validation Attributes - Video
    • 15.3.4. Applying Validation Attributes - Text
    • 15.3.5. Check Your Understanding
  • 15.4. Validating Models in a Controller
    • 15.4.1. Validation Flow
    • 15.4.2. Handling Validation Errors - Video
    • 15.4.3. Handling Validation Errors - Text
      • 15.4.3.1. Using ModelState.IsValid
    • 15.4.4. Check Your Understanding
  • 15.5. Validation and Views
    • 15.5.1. Displaying Error Messages in our View - Video
    • 15.5.2. Displaying Error Messages in our View - Text
    • 15.5.3. Changing the Color of Error Messages
      • 15.5.3.1. _Layout.cshtml Updates
    • 15.5.4. Check Your Understanding
  • 15.6. Exercises: ViewModels and Model Validation
    • 15.6.1. Bonus Mission
  • 15.7. Studio: Spa User Validation
    • 15.7.1. Getting Started
    • 15.7.2. Creating a New ViewModel
    • 15.7.3. Add Validation Attributes
    • 15.7.4. Refactoring UserController
      • 15.7.4.1. Validating That Passwords Match
    • 15.7.5. Refactoring the Views
    • 15.7.6. Test, Test, Test!
    • 15.7.7. Bonus Mission
  • ← 14.6. Studio: Spa User Signup
  • 15.1. ViewModels and Passing Data To and From Views →

Back to top

Page Source