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