I have a controller action which return a JSON data. It can be easily accessible through a getJSON method. But I want that JSON data to be retrieved through web API.
My controller code is
public ActionResult GetProfile(string profileName)
{
var profileDataService = new BokingEngine.MasterDataService.GetProfileDataService();
var request = new ProfileSearchCriteria { Name = profileName };
var profileDetails = profileDataService.GetList(request);
return Json(profileDetails, JsonRequestBehavior.AllowGet);
}