private void LoadMovies(string festivalName) { MovieHandler movieHandler = new MovieHandler(); List <MovieModel> movieList = movieHandler.GetAllMoviesByFestivalName(festivalName, 0); if (movieList.Count > 0) { Session["FestIndex"] = 1; Session["MovieList"] = movieList; Session["FestName"] = festivalName; btnLoadMore.Enabled = true; CreateTiles(movieList); } }
protected void btnLoadMore_Click(object sender, EventArgs e) { int index = 0; if (Session["FestIndex"] != null) { index = (int)Session["FestIndex"]; if (index > 0) { string festname = Session["FestName"] as string; List <MovieModel> newlist = movieHandler.GetAllMoviesByFestivalName(festname, index); if (newlist != null) { List <MovieModel> oldlist = Session["MovieList"] as List <MovieModel>; oldlist.AddRange(newlist); Session["MovieList"] = oldlist; Session["FestIndex"] = ++index; CreateTiles(oldlist); } } } }