i am using rest api to fetch and save the data in database using jquery or angularjs, but i want to ask you about which approach is best for doing this.
- using jquery to post the data
- using angularjs to post the data
- using c# code behind to post the data using mvc.
performance and security wise which is best.
Best How To :
There is no 'best' way to do this, but I'd suggest implementing your RESTful API using ASP.NET Web API and then consuming that with AngularJS on the front-end (using the $http service). It's a pretty neat way of communicating with your APIs without having to navigate away from the page, as you would have to do if it was all implemented using ASP.NET MVC.
But then I suppose it depends what you're actually implementing, does it make sense to navigate away from a page after creating or updating something? If you're creating entities from a HTML form then it would make sense to navigate the user to a completely different page after creating/updating. But if you're doing something different like changing the order of entities in a list, consuming a RESTful API without navigating away from the page would make sense.