public void requirementListManagement(HttpContext context) { context.Response.ContentType = "text/plain"; List <Requirement> list = requirementService.getAllRequirementList(); StringBuilder jsonString = new StringBuilder(); Dictionary <String, Object> dictionary = new Dictionary <string, object>(); jsonString.Append("["); int i = 1; foreach (Requirement requirement in list) { dictionary.Add("Id", requirement.Id); dictionary.Add("requirementName", requirement.RequirementName); dictionary.Add("requirementDesc", requirement.RequirementDesc); dictionary.Add("categoryId", requirement.RequirementCategory.Id); dictionary.Add("priority", requirement.Priority); dictionary.Add("userId", requirement.User.Id); dictionary.Add("nickName", requirement.User.NickName); dictionary.Add("teleNumber", requirement.User.TeleNumber); dictionary.Add("createTime", requirement.CreateTime); dictionary.Add("modifyTime", requirement.ModifyTime); dictionary.Add("requirementStatus", requirement.RequirementStatus); dictionary.Add("success", "true"); jsonString.Append(JsonUtil.toJson(dictionary)); if (i < list.Count) { jsonString.Append(","); } i++; dictionary.Clear(); } jsonString.Append("]"); context.Response.Write(jsonString.ToString()); }