Пример #1
0
        public override void DataBind()
        {
            PhotoAlbumsManager pMgr = new PhotoAlbumsManager();
            DataRow            dr   = pMgr.GetAlbumDetails(AlbumName);

            if (dr != null)
            {
                this.DataItem = pMgr.GetAlbumDetails(AlbumName);

                base.DataBind();
            }
        }
        public override void DataBind()
        {
            if (_bound)
            {
                return;
            }
            _bound = true;

            PhotoAlbumsManager pMgr = new PhotoAlbumsManager();

            if (AlbumId != null)
            {
                this.DataItem = pMgr.GetAlbumDetails(AlbumId.Value);
            }
            else if (AlbumName != "")
            {
                this.DataItem = pMgr.GetAlbumDetails(AlbumName);
            }



            base.DataBind();

            if (OverridePageTitle)
            {
                Config cfg = new Config();

                if (MyPage != null)
                {
                    DataRow album = this.DataItem as DataRow;

                    MyPage.CustomTitle = string.Format("{0} - {1}",
                                                       StringUtils.StripOutHtmlTags(album["DisplayName"].ToString()),
                                                       cfg.GetKey("SiteName"));

                    if (!String.IsNullOrEmpty(album["Description"].ToString()))
                    {
                        MyPage.Description = string.Format("{0}",
                                                           StringUtils.StripOutHtmlTags(album["Description"].ToString()));
                    }
                }
            }
        }