
- C#
- Intermediate
About this Course
In this course, you’ll learn how to create forms using ASP.NET MVC. Along the way, you’ll use various field types and form validation as we build a web version of the Fitness Frog application from C# Basics.
What you'll learn
- Creating Forms for CRUD Applications
- Handling Form Posts
- Model State
- Using HTML Helpers to Create Form Fields
- Model Binding
- Client-Side and Server-Side Form Validation
Introducing CRUD Applications
We’ll start with an introduction to CRUD applications. Then we’ll review, download, and setup the Fitness Frog Web App that we’ll be completing in this course.
6 stepsCreating a Basic Form
We’ll update the "Add Entry" page's HTML form so that our users can add entries. Along the way, we’ll look at the various ASP.NET MVC features that we can use to create forms. We’ll also look at how we can use model binding to simplify our code.
15 steps-
Getting Familiar with Our HTML Form
6:13
-
HTML Forms Review
5 questions
-
Handling a Form Post
3:41
-
Using Model Binding to Capture POST Data
8:34
-
Adding a POST Action Method
1 objective
-
Working with Non-String Data
6:21
-
Invalid Values and ModelState
5:13
-
Creating Forms Using the HTML Helpers
6:43
-
Using HTML Helpers
3 objectives
-
Using Our Models
5:11
-
Completing Our Model Related Updates
6:23
-
Using Strongly Typed HTML Helpers
3 objectives
-
Redirecting Back to the List Page
7:12
-
Redirecting to an Action
1 objective
-
Section Review
5 questions
Improving Our Form
We’ll improve our form by adding a drop down list, radio buttons, a check box, and a date picker.
9 stepsAdding Form Validation
We’ll learn how to add validation to our form in order to prevent the user from providing “bad” or incorrect data. We’ll also take a look at the differences between server-side and client-side validation.
11 steps-
Introducing Form Validation
4:04
-
Form Validation
5 questions
-
Implementing Server-Side Validation Using ModelState
5:45
-
Adding Server-Side Validations Using ModelState
1 objective
-
Implementing Server-Side Validation Using Data Annotations
4:36
-
Adding Server-Side Validations Using Data Annotations
1 objective
-
Displaying Validation Messages
5:31
-
Displaying Validation Messages
1 objective
-
Implementing Unobtrusive Client-Side Validation
10:11
-
Improving Validation CSS Styles
6:03
-
Section Review
5 questions
Finishing Our CRUD Web App
We’ll finish our web app by adding “Edit Entry” and “Delete Entry” pages.
8 stepsTeacher
-
James Churchill
Before joining the Treehouse team, James worked as a consultant for over 10 years doing web development using .NET and variety of open source technologies. James enjoys participating in the developer community, presenting at and attending meetups, code camps, and conferences. When not working, James enjoys learning, skiing, playing music, and watching movies.