示例#1
0
    protected void Rotator1_ItemClick(object sender, RadRotatorEventArgs e)
    {
        Label lbl = e.Item.FindControl("LabelID") as Label;

        TextBoxImageOrder.Text = lbl.Text;
        RadListViewMainImage.DataBind();
    }
        void RadRotator1_ItemClick(object sender, RadRotatorEventArgs e)
        {
            string home = this.PortalSettings.HomeDirectoryMapPath;

            string[] fi = Directory.GetFiles(home + ImageDirectory);

            if (fi.Length > 0)
            {
                string imageFile = fi[e.Item.Index];
                if (_ImageControl != null)
                {
                    foreach (ImageParameter para in _ImageControl.Parameters)
                    {
                        if (para.Name == "File")
                        {
                            _ImageControl.Parameters.Remove(para);
                            _ImageControl.Parameters.Add(new ImageParameter()
                            {
                                Name = "File", Value = imageFile.Trim()
                            });
                            break;
                        }
                    }
                }
                else
                {
                    imgDetail.ImageUrl = Page.ResolveUrl("~\\BBImagehandler.ashx") + "?Width=" + ((ImageWidth + 10) * ImageCount - 10).ToString() + "&File=" + HttpUtility.UrlEncode(imageFile.Trim());
                }
            }
        }
示例#3
0
        protected void OnRotatorItemDataBound(object sender, RadRotatorEventArgs e)
        {
            DataObject  dataObject = (DataObject)e.Item.DataItem;
            PlaceHolder ph         = (PlaceHolder)e.Item.FindControl("PhItem");
            Control     ctrl       = LoadControl(string.Format("~/UserControls/Templates/{0}", this.OutputTemplate));

            ((IDataObjectWorker)ctrl).DataObject = dataObject;
            ph.Controls.Add(ctrl);
        }
示例#4
0
    protected void rotControl_ItemDataBound(object sender, RadRotatorEventArgs e)
    {
        // get dataitem
        IContent newsItem = e.Item.DataItem as IContent;

        string title  = (string)newsItem.GetMetaData("Title");
        string link   = String.Empty;
        string target = String.Empty;

        //BUILD LINK
        link   = this.ResolveNewsUrl(newsItem.UrlWithExtension);
        target = (this.Target != TargetTypes.none) ? this.Target.ToString() : String.Empty;

        HyperLink lnkItem = e.Item.FindControl("lnkItem") as HyperLink;

        lnkItem.NavigateUrl = link;
        lnkItem.Target      = target;

        Image imgItem = e.Item.FindControl("imgItem") as Image;

        imgItem.ImageUrl      = this.GetItemUrl((string)newsItem.GetMetaData("Thumbnail"));
        imgItem.ToolTip       = title;
        imgItem.AlternateText = title;
        imgItem.Visible       = !String.IsNullOrEmpty(imgItem.ImageUrl);

        //HANDLE DIMENIONS
        if (this.ThumbnailSize > 0)
        {
            if (imgItem.ImageUrl.StartsWith("http://", StringComparison.OrdinalIgnoreCase) || imgItem.ImageUrl.StartsWith("https://", StringComparison.OrdinalIgnoreCase))
            {
                imgItem.Width = Unit.Pixel(this.ThumbnailSize);
            }
            else
            {
                imgItem.ImageUrl += String.Format("?width={0}&height={0}&decreaseOnly=true&proportional=true", this.ThumbnailSize);
            }
        }

        HyperLink lnkHeadline = e.Item.FindControl("lnkTitle") as HyperLink;

        lnkHeadline.Text        = title;
        lnkHeadline.NavigateUrl = link;
        lnkHeadline.Target      = target;

        if (this.DisplaySummary)
        {
            Label lblSummary = e.Item.FindControl("lblSummary") as Label;
            lblSummary.Text = (string)newsItem.GetMetaData("Summary");
        }

        Label lblPublication = e.Item.FindControl("lblPublication") as Label;

        lblPublication.Text = ((DateTime)newsItem.GetMetaData("Publication_Date")).ToString(this.DateFormat);
    }
        /// <summary>
        /// Handles the OnItemDataBound event of the rrThumbnails control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Telerik.Web.UI.RadRotatorEventArgs"/> instance containing the event data.</param>
        protected void rrThumbnails_OnItemDataBound(object sender, RadRotatorEventArgs e)
        {
            var siteActionTemplate = (tbl_SiteActionTemplate)e.Item.DataItem;
            var fileSystemProvider = new FileSystemProvider();

            ((LinkButton)e.Item.FindControl("lbThumbnail")).CommandArgument = siteActionTemplate.ID.ToString();

            ((Image)e.Item.FindControl("imgThumbnail")).ImageUrl      = fileSystemProvider.GetLink(siteActionTemplate.SiteID, "SiteActionTemplates", siteActionTemplate.ID + ".png", FileType.Thumbnail);
            ((Image)e.Item.FindControl("imgThumbnail")).ToolTip       = siteActionTemplate.Title;
            ((Image)e.Item.FindControl("imgThumbnail")).AlternateText = siteActionTemplate.Title;
        }
        /// <summary>
        /// Handles the ItemDataBound event of the RadRotator1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Telerik.Web.UI.RadRotatorEventArgs"/> instance containing the event data.</param>
        protected void RadRotator1_ItemDataBound(object sender, RadRotatorEventArgs e)
        {
            var link  = e.Item.FindControl("newsLink") as HyperLink;
            var image = e.Item.FindControl("newsImage") as Image;
            var imageBackgroundPanel = e.Item.FindControl("ImageBackgroundPanel") as Panel;
            var title = e.Item.FindControl("newsTitle") as Label;
            var text  = e.Item.FindControl("newsText") as Label;

            NewsItem newsItem = (NewsItem)TypeDescriptor.GetProperties(e.Item.DataItem)["NewsItem"].GetValue(e.Item.DataItem);

            Telerik.Sitefinity.Libraries.Model.Image newsImage = (Telerik.Sitefinity.Libraries.Model.Image)TypeDescriptor.GetProperties(e.Item.DataItem)["NewsImage"].GetValue(e.Item.DataItem);

            if (image != null)
            {
                image.ImageUrl = newsImage.MediaUrl;
            }

            if (imageBackgroundPanel != null)
            {
                imageBackgroundPanel.BackImageUrl = newsImage.MediaUrl;
            }

            if (title != null)
            {
                title.Text = newsItem.Title;
            }

            if (text != null)
            {
                text.Text = newsItem.Summary;
            }

            if (link != null && this.TargetNewsPage != null)
            {
                link.NavigateUrl = DataResolver.Resolve(newsItem, "URL", null, this.TargetNewsPage.Id.ToString());
            }

            var wrapperDiv = e.Item.FindControl("wrapperDiv") as Panel;

            if (wrapperDiv != null)
            {
                wrapperDiv.Width  = this.Width;
                wrapperDiv.Height = this.Height;
            }
        }
示例#7
0
        public void rotFeatures_ItemClick(object sender, RadRotatorEventArgs e)
        {
            FeatureListItemInfo feature = Features[e.Item.Index];

            int TabId             = Convert.ToInt32(Settings["ProductListModulePage"]);
            int featureListItemId = feature.FeatureListItemId;

            Controller.DeleteProductFilter(PortalId, FilterSessionId, "FeatureList");

            ProductFilterInfo pf = new ProductFilterInfo();

            pf.FilterSessionId = FilterSessionId;
            pf.FilterSource    = "FeatureList";
            pf.FilterValue     = FeatureListId.ToString() + "|" + featureListItemId.ToString();
            pf.PortalId        = PortalId;
            Controller.NewProductFilter(pf);

            Response.Redirect(Globals.NavigateURL(TabId));
        }
    protected void rotControl_ItemDataBound(object sender, RadRotatorEventArgs e)
    {
        // get dataitem
        IContent newsItem = e.Item.DataItem as IContent;

        string title = (string)newsItem.GetMetaData("Title");
        string link = String.Empty;
        string target = String.Empty;

        //BUILD LINK
        link = this.ResolveNewsUrl(newsItem.UrlWithExtension);
        target = (this.Target != TargetTypes.none) ? this.Target.ToString() : String.Empty;

        HyperLink lnkItem = e.Item.FindControl("lnkItem") as HyperLink;
        lnkItem.NavigateUrl = link;
        lnkItem.Target = target;

        Image imgItem = e.Item.FindControl("imgItem") as Image;
        imgItem.ImageUrl = this.GetItemUrl((string)newsItem.GetMetaData("Thumbnail"));
        imgItem.ToolTip = title;
        imgItem.AlternateText = title;
        imgItem.Visible = !String.IsNullOrEmpty(imgItem.ImageUrl);

        //HANDLE DIMENIONS
        if (this.ThumbnailSize > 0)
        {
            if (imgItem.ImageUrl.StartsWith("http://", StringComparison.OrdinalIgnoreCase) || imgItem.ImageUrl.StartsWith("https://", StringComparison.OrdinalIgnoreCase))
            {
                imgItem.Width = Unit.Pixel(this.ThumbnailSize);
            }
            else
            {
                imgItem.ImageUrl += String.Format("?width={0}&height={0}&decreaseOnly=true&proportional=true", this.ThumbnailSize);
            }
        }

        HyperLink lnkHeadline = e.Item.FindControl("lnkTitle") as HyperLink;
        lnkHeadline.Text = title;
        lnkHeadline.NavigateUrl = link;
        lnkHeadline.Target = target;

        if (this.DisplaySummary)
        {
            Label lblSummary = e.Item.FindControl("lblSummary") as Label;
            lblSummary.Text = (string)newsItem.GetMetaData("Summary");
        }

        Label lblPublication = e.Item.FindControl("lblPublication") as Label;
        lblPublication.Text = ((DateTime)newsItem.GetMetaData("Publication_Date")).ToString(this.DateFormat);
    }
示例#9
0
        protected void rotFeatures_DataBound(object sender, RadRotatorEventArgs e)
        {
            if (IsConfigured)
            {
                string              template;
                int                 imageWidth      = 200;
                RadRotator          rot             = sender as RadRotator;
                RadRotatorItem      item            = e.Item as RadRotatorItem;
                FeatureListItemInfo featureListItem = item.DataItem as FeatureListItemInfo;
                if (featureListItem != null)
                {
                    PlaceHolder ph = e.Item.FindControl("featurePlaceHolder") as PlaceHolder;

                    template = Template;
                    template = template.Replace("[TITLE]", "<asp:Label ID=\"lblTitle\" runat=\"server\" />");
                    if (template.IndexOf("[IMAGE") > -1)
                    {
                        if (template.IndexOf("[IMAGE:") > -1)
                        {
                            string width = template.Substring(template.IndexOf("[IMAGE:") + 7);
                            width = width.Substring(0, width.IndexOf("]"));
                            if (Int32.TryParse(width, out imageWidth) == false)
                            {
                                imageWidth = 200;
                            }
                            template = template.Replace("[IMAGE:" + width + "]", "<asp:PlaceHolder ID=\"phimgFeature\" runat=\"server\" />");
                        }
                        else
                        {
                            template = template.Replace("[IMAGE]", "<asp:PlaceHolder ID=\"phimgFeature\" runat=\"server\" />");
                        }
                    }
                    Control ctrl     = ParseControl(template);
                    Label   lblTitle = FindControlRecursive(ctrl, "lblTitle") as Label;
                    if (lblTitle != null)
                    {
                        lblTitle.Text = featureListItem.FeatureListItem;
                    }

                    PlaceHolder phimgFeature = FindControlRecursive(ctrl, "phimgFeature") as PlaceHolder;
                    if (phimgFeature != null && featureListItem.Image != null)
                    {
                        string fileName =
                            PortalSettings.HomeDirectoryMapPath.Replace(HttpContext.Current.Request.PhysicalApplicationPath, "") +
                            featureListItem.Image.Replace('/', '\\');

                        GeneratedImage imgFeature = new GeneratedImage();
                        imgFeature.ImageHandlerUrl = "~/BBImageHandler.ashx";
                        if (imageWidth > 0)
                        {
                            imgFeature.Parameters.Add(new ImageParameter()
                            {
                                Name = "Width", Value = imageWidth.ToString()
                            });
                        }
                        imgFeature.Parameters.Add(new ImageParameter()
                        {
                            Name = "File", Value = fileName
                        });
                        // TODO: Watermark
                        //if (false)
                        //{
                        //    imgProduct.Parameters.Add(new ImageParameter() { Name = "WatermarkText", Value = Localization.GetString("Sold.Text", this.LocalResourceFile) });
                        //    imgProduct.Parameters.Add(new ImageParameter() { Name = "WatermarkFontFamily", Value = "Verdana" });
                        //    imgProduct.Parameters.Add(new ImageParameter() { Name = "WatermarkFontColor", Value = "Red" });
                        //    imgProduct.Parameters.Add(new ImageParameter() { Name = "WatermarkFontSize", Value = "20" });
                        //}
                        phimgFeature.Controls.Add(imgFeature);
                    }

                    ph.Controls.Add(ctrl);
                }
            }
            else
            {
                rotFeatures.Visible = false;
            }
        }
示例#10
0
 protected void RadRotator2_ItemClick(object sender, RadRotatorEventArgs e)
 {
     Response.Redirect("testimonials.aspx");
 }