I have a bootstrap navbar at the top of my page main page and inside it is a text input. I want it hidden until a search is performed and the user sees the results in the results controller .

This is inside my bootstrap navbar.

<!--language: lang-html -->
<input type="text" class="form-control" placeholder="Search">

For example:

<!--language: lang-none -->
Hidden:  www.example.com/home/index
Visible: www.example.com/results

In this case, you actually don't need to pass any specific information from the controller to the shared layout.

The shared layout can inspect the current route and the behave accordingly.

@if (ViewContext.RouteData.Values["Controller"].ToString() == "results")
{
    <input type="text" class="form-control" placeholder="Search">
}

More Info: