<form method="post" id="modalForm" action="/Test/TestForm" target="myframe">
<input type="text" name="id" required />
<input type="text" name="name" required />
<input type="submit" value="Post" onsubmit="alert('after post!');" />
</form>
[HttpPost]
public IActionResult TestForm(Test test)
{
return View();
}
public class Test
{
public string id;
public string name;
}
What needs to be changed, on the form, to get values to the Test class? Currently the values are null? I would like to keep it simple, without ASP.NET Core helpers.
TestForm(Test test)toTestForm([FromForm]Test test)