Example #1
0
 protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs e)
 {
     string[] tooltipId = e.TargetControlID.Split(new char[] { '_' });
     if (tooltipId.Length == 4)
     {
         Literal literal = new Literal
         {
             Text =
                 AdWordHelper.GetCampaignContent(new Guid(tooltipId[0]),
                                                 new Guid(tooltipId[1]),
                                                 UserDataContext.GetUserDataContext(),
                                                 tooltipId[2],
                                                 "Popup")
         };
         literal.Text = Regex.Replace(literal.Text,
                                      @"(/Pages/Other/AdCampaignRedirecter.aspx\?CID=\w{8}-\w{4}-\w{4}-\w{4}-\w{12})",
                                      "$1&OID=" + tooltipId[1] + "&Word=" + tooltipId[2] + "&Type=PopupLink");
         e.UpdatePanel.ContentTemplateContainer.Controls.Add(literal);
     }
 }
Example #2
0
 protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs e)
 {
     string[] tooltipId = e.TargetControlID.Split(new char[] { '_' });
     if (tooltipId.Length == 4)
     {
         Literal literal = new Literal
         {
             Text =
                 AdWordHelper.GetCampaignContent(new Guid(tooltipId[0]),
                                                 new Guid(tooltipId[1]),
                                                 UserDataContext.GetUserDataContext(),
                                                 tooltipId[2],
                                                 "Popup")
         };
         literal.Text = Regex.Replace(literal.Text,
                                      @"(/Pages/Other/AdCampaignRedirecter.aspx\?CID=\w{8}-\w{4}-\w{4}-\w{4}-\w{12})",
                                      "$1&OID=" + tooltipId[1] + "&Word=" + tooltipId[2] + "&Type=PopupLink");
         e.UpdatePanel.ContentTemplateContainer.Controls.Add(literal);
     }
     else if (e.TargetControlID.IndexOf("Img_") > -1)
     {
         try
         {
             string            pictureId = e.TargetControlID.Substring(4);
             DataObjectPicture picture   = prodPictures.Find(x => x.ObjectID.Value == pictureId.ToGuid());
             Literal           literal   = new Literal
             {
                 Text =
                     string.Format(
                         "<div><div><img src=\"{0}{1}\"></div><div>{2}</div></div>",
                         SiteConfig.MediaDomainName, picture.GetImage(PictureVersion.L),
                         picture.Title)
             };
             e.UpdatePanel.ContentTemplateContainer.Controls.Add(literal);
         }
         catch
         {
         }
     }
 }