hello all,
i have two projects, one is pure web api, there i have my controlls and models, the same api is published in IIS. below is my sample api code to insert data
second project has only html pages(UI Project). from html page using jquery i have collected input, now i have to send them into API published in IIS here, my doubts are
Is is possible to send input to my API from HTML page itself using jQuery? if yes may i know
my web api seems below
// POST: api/Employees
[ResponseType(typeof(tblEmployee))]
[Route("api/PosttblEmployee")]
public IHttpActionResult PosttblEmployee(tblEmployee tblEmployee)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
db.tblEmployees.Add(tblEmployee);
db.SaveChanges();
return CreatedAtRoute("DefaultApi", new { id = tblEmployee.employeeId }, tblEmployee);
}