Can I do a POST AJAX to an MVC Controller or should I use Web API?

The page is loaded as a normal MVC page. The ajax is so the user can add items to their model without having to reload the page.

Right now there is no Web API in the project. I don’t want to add it unless it makes sense but I’m worried that using AJAX on an MVC controller is bad.

All the books I’ve read and at work we only do AJAX to Web API. Is that a convention or am I “allowed” to POST an AJAX to an MVC Controller?


Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *