public class GetGroupHtmlByPid : IHttpHandler { GroupManager group; public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; int parentId = -1; int type = 0; string resultStr = string.Empty; if (!context.Request.QueryString["pid"].IsNullOrEmpty()) { Int32.TryParse(context.Request.QueryString["pid"], out parentId); } if (!context.Request.QueryString["type"].IsNullOrEmpty()) { Int32.TryParse(context.Request.QueryString["type"], out type); } if (parentId >= 0) { try { group = new GroupManager((GroupType)type); var subAg = group.AllGroups.Where(c => c.ParentId == parentId); resultStr += "
"; foreach (Base_group item in subAg) { resultStr += "