protected void LViewBestM_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { Rating rating = (Rating)e.Item.FindControl("RatingBestMO"); List <Movies> bestMovies = logic.TheBestMovieBL(); int IsZero = (bestMovies[e.Item.DataItemIndex].CuntRating); if (IsZero != 0) { rating.CurrentRating = ((bestMovies[e.Item.DataItemIndex].Rating) / (bestMovies[e.Item.DataItemIndex].CuntRating)); } rating.DataBind(); } }