public ActionResult SearchRecentsMain(string Id, string state) { string search = Request.Form["search"]; if (state != "Global" && state != null) { DataRepository helper = new DataRepository(); IList<Item> recents = helper.getMostRecentItemsInNetworkSearch(Id, search, 100); if (recents.Count() < 1) { ViewData["NoResults"] = "Sorry, there are no results for '" + search + "'"; } string yob = helper.getYOB(Id); string stereotype = helper.getStereotype(Id); bool male = helper.isMale(Id); string recentItem = helper.getMostRecentItem(Id); string recentItemId = helper.getMostRecentItemId(Id); string location = helper.getLocation(Id); ViewData["recentTopLinks"] = helper.getItemTopLinks(recents); ViewData["recentYouTubes"] = helper.getItemYouTubes(recents); return PartialView(new ItemViewModel(null, null, null, null, null, recents, Id, "User", yob, stereotype, male, recentItem, "", recentItemId,location)); } else//Global State { DataRepository helper = new DataRepository(); IList<Item> recents = helper.getMostRecentItemsSearch(100, search); if (recents.Count() < 1) { ViewData["NoResults"] = "Sorry, there are no results for '" + search + "'"; } ViewData["recentTopLinks"] = helper.getItemTopLinks(recents); ViewData["recentYouTubes"] = helper.getItemYouTubes(recents); return PartialView(new ItemViewModel(null, null, null, null, null, recents, null, "Global", "", "", false, "", "", "","")); } }