Hi,
Can anyone Please explain with example how to add a record from the modal form in asp.net core through javascript.
I'm not using partial views for this case.
I'm facing problem in how to connect with javascript.
Your help is much appreciated.
Below is the boostrap modal form which is included in .net mvc.

Sachin SinghPosted Oct 24, 2021, 11:02 AM
Sachin SinghPosted Oct 24, 2021, 1:49 PM
C# LearnerPosted Oct 24, 2021, 1:07 PM
Thanks for response.
Could you please correct my below code.Is that correct Will it work? Please let me know
Register
[HttpPost]
public IActionResult additem(model m)
{
try
{
Service.add(m); //sending values to save method defined in service page.
return View("additem", m);
}
catch (Exception ex)
{
return View("additem", m);
}
}