public JsonpResult _TreeViewLoading(int?ID) { int parentId = (ID == null ? 0 : (int)ID); var pages = RP.GetAdminMenuRepository(); string domain = string.Empty; if (!HttpContext.Request.IsLocal && SF.UseMultiDomain()) { domain = "http://" + RP.GetAdminCurrentSettingsRepository().Domain; } IEnumerable nodes = pages.Where(r => r.ParentID == parentId) .Select(item => new { Text = item.Title, ID = item.ID.ToString(), hasChildren = (pages.Count(r2 => r2.ParentID == item.ID) > 0), imageUrl = domain + Url.Content(item.Image), Url = (string.IsNullOrEmpty(item.RedirectTo) ? (domain + item.Url) : item.RedirectTo), SpriteCssClass = "", expanded = (item.IsLangRoot), ReportsTo = parentId }); return(this.Jsonp(nodes)); }
public ActionResult _AjaxLoadingParent(string text) { var l = RP.GetAdminMenuRepository(); return(new JsonResult { Data = new SelectList(l.ToList(), "ID", "Title") }); }