asp.net mvc - Saving JSON file for Ajax to GET -


This may be a stupid question.

I have a file containing JSON data which I get by using get AJAX. As the data has already been serialized, I do not think I need any action results to return Jason? Or do I?

Did I just save the Jason file anywhere else in my project and get the AJAX data from that location? If so, then where is the best practice to save it?

Thank you in advance.

What am I doing:

  public fileResult GetJsonFile () {String fileName = @ "~ \ obj \ data.json"; String contentType = "app / jason"; Returns the new filepath result (filename, content type); }  

As long as someone can recommend a better option of the above method, I will accept it as an answer.

Thank you.


Comments