// Function that will return the JSON-format of all episode list protected void Page_Load(object sender, EventArgs e) { Response.Expires = -1; // Loading the episode from repository EpisodeRepository epsRepository = new EpisodeRepository(); var episodeList = epsRepository.AllEpisodeList(); Response.Clear(); Response.ContentType = "application/json; charset=utf-8"; Response.Write(JsonConvert.SerializeObject(episodeList)); Response.End(); }