AspNetCore.Docs/aspnetcore/tutorials/first-mvc-app-xplat/search.md

31 lines
887 B
Markdown
Raw Normal View History

---
2017-07-01 07:47:15 +08:00
title: Adding Search
author: rick-anderson
description: Shows how to add search to simple ASP.NET Core MVC app
manager: wpickett
2018-01-29 23:21:31 +08:00
ms.author: riande
ms.date: 04/07/2017
ms.prod: asp.net-core
2018-01-29 23:21:31 +08:00
ms.technology: aspnet
ms.topic: get-started-article
uid: tutorials/first-mvc-app-xplat/search
---
2018-04-05 07:51:35 +08:00
[!INCLUDE [adding-model](../../includes/mvc-intro/search1.md)]
Note: SQLlite is case sensitive, so you'll need to search for "Ghost" and not "ghost".
2018-04-05 07:51:35 +08:00
[!INCLUDE [adding-model](../../includes/mvc-intro/search2.md)]
Change the `<form>` tag in the *Views\movie\Index.cshtml* Razor view to specify `method="get"`:
```html
<form asp-controller="Movies" asp-action="Index" method="get">
```
2018-04-05 07:51:35 +08:00
[!INCLUDE [adding-model](../../includes/mvc-intro/search3.md)]
2018-04-05 07:51:35 +08:00
> [!div class="step-by-step"]
> [Previous - Controller methods and views](controller-methods-views.md)
> [Next - Add a field](new-field.md)