I am fairly experienced with AngularJS and in the process of coming to terms with ASP.NET MVC while working with an existing application.
I am having trouble finding a satisfactory way to post changes to data in controls that are not in a webform. ASP.NET MVC has a clean and well documented mechanism for posting web form data, but the "right" way to get data from a view into a model with no submit event eludes me.
The code I am working with uses Ajax to achieve this, but I find it jarring to see a view requiring knowledge of communications protocols and addresses. To me this makes the object a hybrid between view and controller.
So where does such a call belong?
- The View? Is my opinion expressed above wrong?
- The Model? I don't think so. The model should not be concerned with how it is moved around IMO. It would become a model/controller.
- The Controller? Seems the right place to me, but we have very strong positions against this expressed, for example, here: ASP.NET MVC: Access controller instance from view
I can't help feeling that there's a mechanism in ASP.NET MVC to POST non-webform values nearly as cleanly as webform values, but in the absence of such a beast I have to choose whether to place HTTP calls in either M, V or C.
I hope this isn't a stupid question.