public ActionResult GetApplicationHosts(int id) { // Get hosts for application List <ApplicationTokenDetails> result = _applications.GetHosts(id, LoggedInUser); // Encode all tokens foreach (var token in result) { token.Token = HttpUtility.UrlEncode(token.Token); } // Return result return(PartialView("_ApplicationHosts", result)); }