Cleared up some instructions with file paths (#13598)
1) At the beginning: line 16 -included file path for correct index method 2) At line 89 - included file path 3)At line 130 -included file path for correct index methodpull/13600/head
parent
f2581815b3
commit
4f95255249
|
@ -13,7 +13,7 @@ By [Rick Anderson](https://twitter.com/RickAndMSFT)
|
|||
|
||||
In this section, you add search capability to the `Index` action method that lets you search movies by *genre* or *name*.
|
||||
|
||||
Update the `Index` method with the following code:
|
||||
Update the `Index` method found inside *Controllers/MoviesController.cs* with the following code:
|
||||
|
||||
[!code-csharp[](~/tutorials/first-mvc-app/start-mvc/sample/MvcMovie/Controllers/MoviesController.cs?name=snippet_1stSearch)]
|
||||
|
||||
|
@ -86,7 +86,7 @@ However, even if you add this `[HttpPost]` version of the `Index` method, there'
|
|||
|
||||
You can see the search parameter and [XSRF](xref:security/anti-request-forgery) token in the request body. Note, as mentioned in the previous tutorial, the [Form Tag Helper](xref:mvc/views/working-with-forms) generates an [XSRF](xref:security/anti-request-forgery) anti-forgery token. We're not modifying data, so we don't need to validate the token in the controller method.
|
||||
|
||||
Because the search parameter is in the request body and not the URL, you can't capture that search information to bookmark or share with others. Fix this by specifying the request should be `HTTP GET`:
|
||||
Because the search parameter is in the request body and not the URL, you can't capture that search information to bookmark or share with others. Fix this by specifying the request should be `HTTP GET` found in the *Views/Movies/Index.cshtml* file.
|
||||
|
||||
[!code-html[](~/tutorials/first-mvc-app/start-mvc/sample/MvcMovie22/Views/Movies/IndexGet.cshtml?highlight=12&range=1-23)]
|
||||
|
||||
|
@ -127,7 +127,7 @@ When the user searches for the item, the search value is retained in the search
|
|||
|
||||
## Add search by genre to the Index view
|
||||
|
||||
Update `Index.cshtml` as follows:
|
||||
Update `Index.cshtml` found in *Views/Movies/* as follows:
|
||||
|
||||
[!code-cshtml[](~/tutorials/first-mvc-app/start-mvc/sample/MvcMovie22/Views/Movies/IndexFormGenreNoRating.cshtml?highlight=1,15,16,17,19,28,31,34,37,43)]
|
||||
|
||||
|
|
Loading…
Reference in New Issue