I have an Index.cshtml view, a Filter.cshtml partial view and Results.cshtml partial view. I want to see values from my Results.cshtml parital view after the user has clicked the search button, along with the content from Index.cshtml and Filter.cshtml. How do I structure my page(s) to see content from Results.cshtml after the search button is clicked, along with other content?
This is what I have for my Index.cshtml view
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@{ Html.RenderPartial("Filter"); }
@{ Html.RenderPartial("Results"); }
You could use a view model:
and then:
and in the view:
and using templates: