Let’s assume you have a MVC controller action “getEmployee” which emits out employee JSON object as shown in the below code. Please note you can always emit JSON from any server technology like WCF , ASP.NET , MVC etc. Do read this link where we have discussed how we can emit JSON data using MVC and WCF. http://questpond.tumblr.com/post/32457322254/json-and-c-interview-questions-what-is-json
- The first parameter is the URL which emits out JSON. For instance in the below code the URL is “/Employee/getEmployee”.
- The next parameter helps us to pass data to the resource which emits out JSON currently it’s the MVC action. Currently we are only doing a get so the second parameter is NULL for now.