2016-10-29 01:35:15 +08:00
---
2016-11-17 08:24:57 +08:00
title: Adding Search | Microsoft Docs
2016-10-29 01:35:15 +08:00
author: rick-anderson
2017-03-04 05:35:47 +08:00
description: Shows how to add search to simple ASP.NET Core MVC app
2016-11-18 04:13:02 +08:00
keywords: ASP.NET Core,
2016-10-29 01:35:15 +08:00
ms.author: riande
manager: wpickett
2017-03-04 05:35:47 +08:00
ms.date: 03/07/2017
2016-10-29 01:35:15 +08:00
ms.topic: article
ms.assetid: d69e5529-8ef6-4628-855d-200206d962b9
2016-11-17 08:24:57 +08:00
ms.technology: aspnet
2017-03-03 08:50:36 +08:00
ms.prod: asp.net-core
2016-10-29 01:35:15 +08:00
uid: tutorials/first-mvc-app/search
---
2017-04-10 08:52:07 +08:00
[!INCLUDE[adding-model ](../../includes/mvc-intro/search1.md )]
2016-10-29 01:35:15 +08:00
You can quickly rename the `searchString` parameter to `id` with the **rename** command. Right click on `searchString` ** > Rename**.
2016-12-23 02:03:29 +08:00
![Contextual menu ](search/_static/rename.png )
2016-10-29 01:35:15 +08:00
The rename targets are highlighted.
2016-12-23 02:03:29 +08:00
![Code editor showing the variable highlighted throughout the Index ActionResult method ](search/_static/rename2.png )
2016-10-29 01:35:15 +08:00
Change the parameter to `id` and all occurrences of `searchString` change to `id` .
2016-12-23 02:03:29 +08:00
![Code editor showing the variable has been changed to id ](search/_static/rename3.png )
2016-10-29 01:35:15 +08:00
2017-04-10 08:52:07 +08:00
[!INCLUDE[adding-model ](../../includes/mvc-intro/search2.md )]
2016-10-29 01:35:15 +08:00
2017-04-10 08:52:07 +08:00
Notice how intelliSense helps us update the markup.
2016-10-29 01:35:15 +08:00
2016-12-23 02:03:29 +08:00
![Intellisense contextual menu with method selected in the list of attributes for the form element ](search/_static/int_m.png )
2016-10-29 01:35:15 +08:00
2016-12-23 02:03:29 +08:00
![Intellisense contextual menu with get selected in the list of method attribute values ](search/_static/int_get.png )
2016-10-29 01:35:15 +08:00
Notice the distinctive font in the `<form>` tag. That distinctive font indicates the tag is supported by [Tag Helpers ](../../mvc/views/tag-helpers/intro.md ).
2016-12-23 02:03:29 +08:00
![form tag with purple text ](search/_static/th_font.png )
2016-10-29 01:35:15 +08:00
2017-04-10 08:52:07 +08:00
[!INCLUDE[adding-model ](../../includes/mvc-intro/search3.md )]
2016-10-29 01:35:15 +08:00
2016-11-10 13:17:21 +08:00
>[!div class="step-by-step"]
[Previous ](controller-methods-views.md )
[Next ](new-field.md )