public JsonResult TagItems(int pageNumber, string key) { var model = new BootBaronLib.AppSpec.DasKlub.BOL.UserContent.Contents(); model.GetContentAllPageWiseKey(pageNumber, pageSize, key); if (model.Count == 0) { // this might have had a dash in it model.GetContentAllPageWiseKey(1, pageSize, ViewBag.KeyName); if (model.Count == 0) { // TODO: combination of with and without, deal with it } } StringBuilder sb = new StringBuilder(); foreach (BootBaronLib.AppSpec.DasKlub.BOL.UserContent.Content cnt in model) { sb.Append(cnt.ToUnorderdListItem); } return Json(new { ListItems = sb.ToString() }); }
public ActionResult Tag(string key) { if (string.IsNullOrEmpty(key)) return new EmptyResult(); ViewBag.KeyName = key; key = key.Replace("-", " "); var model = new BootBaronLib.AppSpec.DasKlub.BOL.UserContent.Contents(); model.GetContentAllPageWiseKey(1, pageSize, key); if (model.Count == 0) { // this might have had a dash in it model.GetContentAllPageWiseKey(1, pageSize, ViewBag.KeyName ); if (model.Count == 0) { // TODO: combination of with and without, deal with it } } ViewBag.EnableLoadingMore = (model.Count < pageSize); ViewBag.TagName = key; LoadTagCloud(); return View(model); }