So i have next app architecture:
- NavController, ListController
- _Layout, which consists of Menu(=PartialViewResult) from NavController and RenderBody section.
Typically requests go to ListController in RenderBody section.
Menu has search textbox. When user wants to search something, searchText goes to ListController as a parameter.
I want to place search text after clicking "find it" in the same textbox. How should i do it to make this workflow beauty?
I hope my picture will bring some clarity. Thanks.
<!-- _Layout (approximate markup) -->
<html>
<head></head>
<body>
@Html.Action("MenuLeft", "Nav")
<div>
@RenderBody()
</div>
</body>
</html>
<!-- Menu PartialView -->
@using (Html.BeginForm("All", "List"))
{
@Html.TextBox("SearchText", null) // searchText should be here
<button type="submit"></button>
}
// Menu Controller
public class NavController : Controller
{
public PartialViewResult Menu()
{
return PartialView("MenuPartial");
}
}
public class ListController : Controller
{
public ViewResult All(String searchText = null)
{
...
return View(model);
}
}