Exemplo n.º 1
0
        private void Control_Init()
        {
            if (!DataEval.IsEmptyQuery(_imageid))
            {
                #region Image Properties
                RadNumericTbx_Height.Value = _height;
                RadNumericTbx_Width.Value  = _width;
                RadNumericTbx_Border.Value = _border;
                #endregion

                if (_isshared)
                {
                    Lib.ImageMgr myImageMgr = new Lib.ImageMgr();
                    Lib.Image    myImage    = myImageMgr.Get_Image_Content(_contentid);

                    _imageurl      = myImage.ImageURL;
                    _alternatetext = myImage.AlternateText;
                    _linkurl       = myImage.LinkURL;
                    _link_target   = myImage.Link_Target;
                }

                // Image Data
                tbx_ImageURL.Text      = _imageurl;
                tbx_AlternateText.Text = _alternatetext;

                // Link Data
                tbx_LinkURL.Text            = _linkurl;
                RadComboBox_LinkTarget.Text = _link_target;
            }
        }
Exemplo n.º 2
0
        private void Control_Init()
        {
            if (!DataEval.IsEmptyQuery(_imageid))
            {
                HtmlImage myHtmlImage = new HtmlImage();

                if (_isshared)
                {
                    Lib.ImageMgr myImageMgr = new Lib.ImageMgr();
                    Lib.Image    myImage    = myImageMgr.Get_Image_Content(_contentid);

                    _imageurl      = myImage.ImageURL;
                    _alternatetext = myImage.AlternateText;
                    _linkurl       = myImage.LinkURL;
                    _link_target   = myImage.Link_Target;
                }

                // ImageURL

                myHtmlImage.Src = _imageurl;

                // AlternateText
                myHtmlImage.Alt = _alternatetext;

                // Image Height
                if (_height > 0)
                {
                    myHtmlImage.Height = _height;
                }

                // Image Width
                if (_width > 0)
                {
                    myHtmlImage.Width = _width;
                }

                // Image Border
                myHtmlImage.Border = _border;


                if (Request.QueryString["PageLink"] == "Disable")
                {
                    PlaceHolder_Content.Controls.Add(myHtmlImage);
                }
                else
                {
                    if (!DataEval.IsEmptyQuery(_linkurl))
                    {
                        HtmlGenericControl myLink = new HtmlGenericControl("a");
                        myLink.Attributes.Add("href", _linkurl);

                        if (!DataEval.IsEmptyQuery(_link_target))
                        {
                            myLink.Attributes.Add("target", _link_target);
                        }

                        myLink.Controls.Add(myHtmlImage);
                        PlaceHolder_Content.Controls.Add(myLink);
                    }
                    else
                    {
                        PlaceHolder_Content.Controls.Add(myHtmlImage);
                    }
                }
            }
        }