change Views/Books/Edit to Views/Movies/Edit (#2381)
parent
edc99e2579
commit
46cb4f7bc3
|
@ -114,7 +114,7 @@ The `[ValidateAntiForgeryToken]` attribute validates the hidden [XSRF](../../sec
|
|||
|
||||
The [model binding](../../mvc/models/model-binding.md) system takes the posted form values and creates a `Movie` object that's passed as the `movie` parameter. The `ModelState.IsValid` method verifies that the data submitted in the form can be used to modify (edit or update) a `Movie` object. If the data is valid it's saved. The updated (edited) movie data is saved to the database by calling the `SaveChangesAsync` method of database context. After saving the data, the code redirects the user to the `Index` action method of the `MoviesController` class, which displays the movie collection, including the changes just made.
|
||||
|
||||
Before the form is posted to the server, client side validation checks any validation rules on the fields. If there are any validation errors, an error message is displayed and the form is not posted. If JavaScript is disabled, you won't have client side validation but the server will detect the posted values that are not valid, and the form values will be redisplayed with error messages. Later in the tutorial we examine [Model Validation](../../mvc/models/validation.md) validation in more detail. The [Validation Tag Helper](../../mvc/views/working-with-forms.md) in the *Views/Book/Edit.cshtml* view template takes care of displaying appropriate error messages.
|
||||
Before the form is posted to the server, client side validation checks any validation rules on the fields. If there are any validation errors, an error message is displayed and the form is not posted. If JavaScript is disabled, you won't have client side validation but the server will detect the posted values that are not valid, and the form values will be redisplayed with error messages. Later in the tutorial we examine [Model Validation](../../mvc/models/validation.md) validation in more detail. The [Validation Tag Helper](../../mvc/views/working-with-forms.md) in the *Views/Movies/Edit.cshtml* view template takes care of displaying appropriate error messages.
|
||||
|
||||
![image](controller-methods-views/_static/val.png)
|
||||
|
||||
|
|
Loading…
Reference in New Issue