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 SinghRank #66 · 26.2K reputationPosted Oct 24, 2021, 7:02 AM EDT
C# Learner35 reputationPosted Oct 24, 2021, 9:07 AM EDT
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);
}
}
Sachin SinghRank #66 · 26.2K reputationPosted Oct 24, 2021, 9:49 AM EDT