Wednesday, April 4, 2018

How do you pass data retrieved from a server in ASP.NET Core to the client side?

I am trying to pass the data retrieved to my client side, which is Angular. I will use a HTTP request using AJAX from Angular to bring in the data and populate my view.

I have the code for data retrieval from the server in a class. I have a member function that does the retrieval.

  1. How do I convert the retrieved data to JSON and return it in the AJAX call? (Speaking from the .NET side)
  2. And where do I call this function? Should I be creating the instance as a Model and call the function from the controller? I am really confused by this.
How do you pass data retrieved from a server in ASP.NET Core to the client side? Click here
  • Blogger Comment
  • Facebook Comment

0 comments:

Post a Comment

The webdev Team