private void LoadMovie()
 {
     var movieControl = new MovieControl {ID = "MainMovie", Height = 300, Width = 400};
     var settingsRepo = new SettingsRepository();
     var settings = settingsRepo.GetSettings();
     if (settings == null)
         return;
     movieControl.Url = settings.HomePageMovieUrl;
     if (!string.IsNullOrEmpty(settings.CouponOfTheMonthUrl))
         litCoupon.Text = "<a href='" + settings.CouponOfTheMonthUrl + "'>Check Here</a> To Download The Coupon Of The Month";
     pnlMovie.Controls.Add(movieControl);
 }
 private void BindRepeater()
 {
     var auto = ViewState["auto"] as Automobile;
     if (auto == null || auto.Images == null)
         return;
     rptImages.DataSource = auto.Images.Where(x => x.MediaType == MediaType.Image).ToList();
     rptImages.DataBind();
     var youtubemovies = auto.Images.Where(x => x.MediaType == MediaType.Youtube).ToList();
     var serverMovies = auto.Images.Where(x => x.MediaType == MediaType.Server);
     foreach (var serverMovie in serverMovies)
     {
         var movieControl = new MovieControl
                                {
                                    Url = serverMovie.Url,
                                    Width = 480,
                                    Height = 360
                                };
         pnlMovies.Controls.Add(movieControl);
         /**/
         //var btn = new Button();
         //btn.CommandArgument = serverMovie.Id.ToString();
         //btn.Click += new EventHandler(btn_Click);
         //pnlMovies.Controls.Add(btn);
     }
     foreach (var youtubeMov in youtubemovies)
     {
         var youtubeMovControl = new YoutubeMovieControl {Url = youtubeMov.Url, Width = 480, Height = 360 };
         pnlYouTube.Controls.Add(youtubeMovControl);
         //var btn = new Button();
         //btn.CommandArgument = youtubeMov.Id.ToString();
         //btn.Click += new EventHandler(btn_Click);
         //pnlYouTube.Controls.Add(btn);
     }
 }