I have experience on Web development on Node JS(front and backend). Now I'm moving to latest Microsoft ASP.Net Core(.Net6) MVC. I love the way they are using c# code in Views(.cshtml). But I got into a situation that I could easily resolve by Javascript but not with c#. Below is the screen. I'm able to enter name and click on "Submit" button. It will return me the result grid. But I'm using return View code.
public IActionResult Index(Person p)
{
string sPersonKeyword = HttpContext.Request.Form["Person_keyword"];
DBDataGet(sPersonKeyword);
return View();
}
The code above send back whole page, leading to my old value on search input box disappear. I know that I could change my technology to do MVC with Ajax in the cshtml, which I used to do in my Node JS projects. Is there any way I could do similar "Partial web page rendering" in cshtml views using c# coding. I tried to create and use Partial view, it still refresh the whole page.
return PartialView("_IndexPartial",recipes);
Below is how my screen looks like: Screen design