示例#1
0
        public void BadCastAlternateText()
        {
            Hashtable table = new Hashtable();

            table ["AlternateText"] = 52;
            AdCreatedEventArgs e = new AdCreatedEventArgs(table);
        }
 protected void Rotator_AdCreated(object sender, AdCreatedEventArgs e)
 {
     /*string NavUrl = e.NavigateUrl;
      * NavUrl = NavUrl.Replace("~/aspx/adredirector.aspx?id=", "");
      * string[] parts = NavUrl.Split('&');
      *
      * if (firstAd == 0)
      * {
      *      firstAd = Convert.ToInt32(parts[0]);
      * }
      * else
      * {
      *      if (firstAd == Convert.ToInt32(parts[0]))
      *      {
      *              //Response.Write("DUP");
      *              Ad sub = Ad.GetNewAd(2, Convert.ToInt32(parts[0]));
      *              e.NavigateUrl = sub.NavigateUrl;
      *              e.ImageUrl = sub.ImageUrl;
      *              NavUrl = NavUrl.Replace("~/aspx/adredirector.aspx?id=", "");
      *              parts = NavUrl.Split('&');
      *      }
      * }
      *
      * Ad A = new Ad(Convert.ToInt32(parts[0]));
      * A.DisplayedCount++;
      * A.Update();*/
 }
示例#3
0
        public void BadCastNavigateUrl()
        {
            Hashtable table = new Hashtable();

            table ["NavigateUrl"] = 52;
            AdCreatedEventArgs e = new AdCreatedEventArgs(table);
        }
示例#4
0
    protected void adRotator_AdCreated(object sender, AdCreatedEventArgs e)
    {
        //try
        // {
        cmd = new MySqlCommand("select * from moviedb where imgpath='" + e.AlternateText + "'", con);
        dr  = cmd.ExecuteReader();
        while (dr.HasRows)
        {
            if (dr.Read())
            {
                Label1.Text = dr["name"].ToString();
                Label5.Text = dr["theatre"].ToString();
                Label3.Text = dr["director"].ToString();
                Label2.Text = dr["cast"].ToString();
                Label4.Text = dr["genre"].ToString();
            }
            else
            {
                Label1.Text = "-";
                Label5.Text = "-";
                Label3.Text = "-";
                Label2.Text = "-";
                Label4.Text = "-";
            }
        }
        dr.Close();

        /*}
         * catch (Exception err)
         * {
         *  MessageBox.Show("Following Error Occured: "+err.Message);
         * }
         * // MessageBox.Show(Label1.Text+Label2.Text+Label3.Text+Label4.Text+Label5.Text);
         */
    }
示例#5
0
	protected void AdRotator1_AdCreated(object sender, AdCreatedEventArgs e)
	{
		// Synchronize the Hyperlink control.
		lnkBanner.NavigateUrl = e.NavigateUrl;
		// Synchronize the text of the link.
		lnkBanner.Text = "Click here for information about our sponsor: ";
		lnkBanner.Text += e.AlternateText;
	}
示例#6
0
 protected void AdRotator1_AdCreated(object sender, AdCreatedEventArgs e)
 {
     // Synchronize the Hyperlink control.
     lnkBanner.NavigateUrl = e.NavigateUrl;
     // Synchronize the text of the link.
     lnkBanner.Text  = "Click here for information about our sponsor: ";
     lnkBanner.Text += e.AlternateText;
 }
示例#7
0
        // protected method (which can be overridden by subclasses) for
        // raising user events
        protected virtual void OnAdCreated(AdCreatedEventArgs e)
        {
            AdCreatedEventHandler handler = (AdCreatedEventHandler)Events[EventAdCreated];

            if (handler != null)
            {
                handler(this, e);
            }
        }
    protected void Ads_AdCreated(Object sender, AdCreatedEventArgs e)
    {
        //// Syncronize
        lnkBanner.NavigateUrl = e.NavigateUrl;

        //// Syncronize the text of the link
        lnkBanner.Text = "<br />" + e.AlternateText;
        lnkBanner.Text += "<br />Click here for more Information about this wonderful product <br /><br />";
    }
示例#9
0
        public void Defaults()
        {
            Hashtable          table = new Hashtable();
            AdCreatedEventArgs e     = new AdCreatedEventArgs(table);

            Assert.AreEqual(e.AdProperties, table, "Constructor");

            e = new AdCreatedEventArgs(null);
            Assert.AreEqual(e.AdProperties, null, "Null Constructor");
        }
示例#10
0
 protected void AdRotator1_AdCreated(object sender, AdCreatedEventArgs e)
 {
     //使用e.AlternateText获取图片文本
     HyperLink1.Text = e.AlternateText;
     //使用e.NavigateUrl获取链接的信息
     Uri PicPath = new Uri(Request.Url,e.NavigateUrl.Substring(3));
     //获取Uri的绝对路径
     string str = PicPath.AbsolutePath;
     HyperLink1.NavigateUrl = str;
 }
示例#11
0
    protected void AdRotator1_AdCreated(object sender, AdCreatedEventArgs e)
    {
        //使用e.AlternateText获取图片文本
        HyperLink1.Text = e.AlternateText;
        //使用e.NavigateUrl获取链接的信息
        Uri PicPath = new Uri(Request.Url, e.NavigateUrl.Substring(3));
        //获取Uri的绝对路径
        string str = PicPath.AbsolutePath;

        HyperLink1.NavigateUrl = str;
    }
示例#12
0
        public void SetPropsInCtor()
        {
            Hashtable table = new Hashtable();

            table ["AlternateText"] = "alt text";
            table ["ImageUrl"]      = "image url";
            table ["NavigateUrl"]   = "nav url";
            AdCreatedEventArgs e = new AdCreatedEventArgs(table);

            Assert.AreEqual(e.AlternateText, "alt text", "alt text");
            Assert.AreEqual(e.ImageUrl, "image url", "image url");
            Assert.AreEqual(e.NavigateUrl, "nav url", "nav url");
        }
示例#13
0
        protected void AdRotator_AdCreated(object sender, AdCreatedEventArgs e)
        {
            ADOLinkShareEasyConfig alsec = new ADOLinkShareEasyConfig();

            //Let's add http if not present.
            UriBuilder ub = new UriBuilder(Server.UrlDecode(Request.Params["url2"]));

            if (String.IsNullOrEmpty(ub.Scheme))
            {
                ub.Scheme = "http";
            }

            Response.AddHeader("REFRESH", String.Format("{0:d};url={1}", alsec.Find().TransferAfterSeconds, ub.Uri));
        }
示例#14
0
 protected void adRotator_AdCreated(object sender, AdCreatedEventArgs e)
 {
     //string strID = e.AdProperties["ID"].ToString();
     //string[] oAds = (string[])Session["adRotatorAds"];
     //for (int ii=0; ii<oAds.Length; ii++)
     //{
     //    if (oAds[ii] == null || oAds[ii] == "")
     //    {
     //        oAds[ii] = strID;
     //        break;
     //    }
     //    else if (oAds[ii] == strID)
     //    {
     //        Response.Redirect(Request.Path);
     //    }
     //}
 }
示例#15
0
        public void ModifyProps()
        {
            Hashtable table = new Hashtable();

            table ["AlternateText"] = "alt text";
            table ["ImageUrl"]      = "image url";
            table ["NavigateUrl"]   = "nav url";
            AdCreatedEventArgs e = new AdCreatedEventArgs(table);

            e.AlternateText = "foo";
            Assert.AreEqual(e.AdProperties ["AlternateText"],
                            "alt text", "alt text");

            e.ImageUrl = "bar";
            Assert.AreEqual(e.AdProperties ["ImageUrl"],
                            "image url", "image url");

            e.NavigateUrl = "baz";
            Assert.AreEqual(e.AdProperties ["NavigateUrl"],
                            "nav url", "nav url");
        }
示例#16
0
        private void WebAdCreated(Object sender, AdCreatedEventArgs e)
        {
            // Override the value since it may have been changed by device
            // select

            // AdProperties can be null when ad file is not specified
            // correctly.
            if (e.AdProperties != null)
            {
                e.ImageUrl    = (String)e.AdProperties[ImageKey];
                e.NavigateUrl = (String)e.AdProperties[NavigateUrlKey];
            }

            // Then invoke user events for further manipulation specified by
            // user
            OnAdCreated(e);

            // Finally, set the necessary properties to the base Image class
            _image.ImageUrl      = ResolveAdRotatorUrl(e.ImageUrl);
            _image.AlternateText = e.AlternateText;
            _image.NavigateUrl   = ResolveAdRotatorUrl(e.NavigateUrl);
        }
示例#17
0
        public void SetProps()
        {
            AdCreatedEventArgs e = new AdCreatedEventArgs(null);

            e.AlternateText = "alt text";
            Assert.AreEqual(e.AlternateText, "alt text", "alt text");

            e.AlternateText = null;
            Assert.AreEqual(e.AlternateText, null, "null alt text");

            e.ImageUrl = "image url";
            Assert.AreEqual(e.ImageUrl, "image url", "image url");

            e.ImageUrl = null;
            Assert.AreEqual(e.ImageUrl, null, "null image url");

            e.NavigateUrl = "nav url";
            Assert.AreEqual(e.NavigateUrl, "nav url", "nav url");

            e.NavigateUrl = null;
            Assert.AreEqual(e.NavigateUrl, null, "null nav url");
        }
示例#18
0
    protected void adRotator_AdCreated(object sender, AdCreatedEventArgs e)
    {
        //try
           // {
            cmd = new MySqlCommand("select * from moviedb where imgpath='" + e.AlternateText + "'", con);
            dr = cmd.ExecuteReader();
            while (dr.HasRows)
            {
                if (dr.Read())
                {
                    Label1.Text = dr["name"].ToString();
                    Label5.Text = dr["theatre"].ToString();
                    Label3.Text =  dr["director"].ToString();
                    Label2.Text = dr["cast"].ToString();
                    Label4.Text =dr["genre"].ToString();

                }
                else
                {
                    Label1.Text = "-";
                    Label5.Text = "-";
                    Label3.Text = "-";
                    Label2.Text = "-";
                    Label4.Text = "-";

                }
            }
            dr.Close();
        /*}
        catch (Exception err)
        {
            MessageBox.Show("Following Error Occured: "+err.Message);
        }
           // MessageBox.Show(Label1.Text+Label2.Text+Label3.Text+Label4.Text+Label5.Text);
           */
    }
 protected void AdRotator1_Event(object sender, AdCreatedEventArgs e)
 {
     AdRotator1.NavigateUrlField = "www.google.com";        
 }
示例#20
0
 protected void Ads_AdCreated(object sender, AdCreatedEventArgs e)
 {
 }
示例#21
0
 protected virtual void OnAdCreated(AdCreatedEventArgs e)
 {
     AdCreatedEventHandler h = (AdCreatedEventHandler) Events [AdCreatedEvent];
     if (h != null)
         h (this, e);
 }
示例#22
0
 protected void AdRotator1_AdCreated(object sender, AdCreatedEventArgs e)
 {
 }
示例#23
0
 // ----------------------------------------------------------------------------------------------------
 protected void AdRotator_AdCreated(object sender, AdCreatedEventArgs e)
 {
     SqlDataSource1.InsertParameters["advid"].DefaultValue = e.AdProperties["advid"].ToString();
     SqlDataSource1.Insert();
     e.NavigateUrl = "~/AdvHandler.ashx?advid=" + e.AdProperties["advid"].ToString();
 }
 protected void AdRotator1_AdCreated(object sender, AdCreatedEventArgs e)
 {
     e.NavigateUrl = "Handler.ashx?AdUrl=" + e.NavigateUrl;
 }
示例#25
0
 protected void AdRotator_Ad(object sender, AdCreatedEventArgs e)
 {
     e.NavigateUrl = "https://github.com/Nike98/personal-code";
 }
示例#26
0
 protected void AdRotator1_AdCreated(object sender, AdCreatedEventArgs e)
 {
     e.NavigateUrl = "AdHandler.ashx?AdUrl=" + e.NavigateUrl;
 }
示例#27
0
    // ----------------------------------------------------------------------------------------------------

    protected void AdRotator_AdCreated(object sender, AdCreatedEventArgs e)
    {
        SqlDataSource1.InsertParameters["advid"].DefaultValue = e.AdProperties["advid"].ToString();
        SqlDataSource1.Insert();
        e.NavigateUrl = "~/AdvHandler.ashx?advid=" + e.AdProperties["advid"].ToString();
    }
示例#28
0
 protected void AdRotator1_AdCreated(object sender, AdCreatedEventArgs e)
 {
     Response.Redirect("HomePage.aspx");
 }
示例#29
0
 /// <summary>
 /// Handles the AdCreated event of the AdRotator1 control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.Web.UI.WebControls.AdCreatedEventArgs"/> instance containing the event data.</param>
 protected void AdRotator1_AdCreated(object sender, AdCreatedEventArgs e)
 {
     lblAd.Text = e.AlternateText;
 }
示例#30
0
 protected void AdRotator4_AdCreated(object sender, AdCreatedEventArgs e)
 {
 }
示例#31
0
 protected void AdRotator1AdCreated(object sender, AdCreatedEventArgs e)
 {
     e.NavigateUrl = "/Content/AdRedirect.aspx?Adpath=" + HttpUtility.UrlEncode(e.NavigateUrl);
 }
 protected void AdRotator1_AdCreated(object sender, AdCreatedEventArgs e)
 {
     HyperLink1.Text        = e.AlternateText;
     HyperLink1.NavigateUrl = e.NavigateUrl;
     Update();
 }
示例#33
0
 protected void AdRotator1_Event(object sender, AdCreatedEventArgs e)
 {
     AdRotator1.NavigateUrlField = "www.google.com";
 }
示例#34
0
 /// <summary>
 /// Handles the AdCreated event of the AdRotator1 control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.Web.UI.WebControls.AdCreatedEventArgs"/> instance containing the event data.</param>
 protected void AdRotator1_AdCreated(object sender, AdCreatedEventArgs e)
 {
     lblAd.Text = e.AlternateText;
 }
示例#35
0
 protected void AdRotator1AdCreated(object sender, AdCreatedEventArgs e)
 {
     e.NavigateUrl = "~/Advertiser/AdHandler.ashx?id=" + e.AdProperties["ID"];
 }
示例#36
0
 //adrotator(did you know) done by David Stoddard, allows for information to display on the page
 protected void AdRotator1_AdCreated(object sender, AdCreatedEventArgs e)
 {
     alternateText.Text    = e.AlternateText;
     hyperLink.NavigateUrl = e.NavigateUrl;
 }
 protected void AdRotator1_AdCreated(object sender, AdCreatedEventArgs e)
 {
     Label1.Text = "Click banner for navigate you to " + e.NavigateUrl + " of " + e.AlternateText + " firm";
 }
    // Ensures that all 5 ads served are unique
    // Called everytime an AdRotator object is made, then checks its uniqueness. If not unique, replaces it with a unique ad
    protected void AdCreated_Event(object sender, AdCreatedEventArgs e)
    {
        int    temp = 0;
        String t2   = Convert.ToString(e.ImageUrl);
        int    t3   = Convert.ToInt32(t2[t2.Length - 5]) - 48;

        foreach (int j in asdflist)
        {
            if (t3 == j)
            {
                dupads++;
                temp = 1;
                while (temp == 1)
                {
                    Random r       = new Random();
                    int    newasdf = r.Next(0, 11);
                    while (asdflist.IndexOf(newasdf) != -1 || (newasdf < 0) || (newasdf > 9))
                    {
                        newasdf = r.Next(0, 10);
                    }
                    temp = 0;
                    System.Text.StringBuilder strBuilder = new System.Text.StringBuilder(t2);
                    strBuilder[t2.Length - 5] = Convert.ToChar(newasdf + 48);
                    e.ImageUrl = strBuilder.ToString();
                    switch (newasdf)
                    {
                    case 0:
                        e.NavigateUrl   = "https://www.salliemae.com/";
                        e.AlternateText = "Sallie May Bank";
                        break;

                    case 1:
                        e.NavigateUrl   = "http://theevansconsultinggroup.com/";
                        e.AlternateText = "Visit Evans Consulting";
                        break;

                    case 2:
                        e.NavigateUrl   = "https://www.niccp.com/";
                        e.AlternateText = "Become a College Planning Specialist";
                        break;

                    case 3:
                        e.NavigateUrl   = "https://www.credible.com/";
                        e.AlternateText = "Visit Credible Refinancing and Help";
                        break;

                    case 4:
                        e.NavigateUrl   = "http://moneysavingexpert.com/";
                        e.AlternateText = "Save more!";
                        break;

                    case 5:
                        e.NavigateUrl   = "http://dcm.uhcl.edu/c432016fa02modic/";
                        e.AlternateText = "Visit Vergil's EduLoans";
                        break;

                    case 6:
                        e.NavigateUrl   = "http://www.aslc.us/";
                        e.AlternateText = "Visit Us!";
                        break;

                    case 7:
                        e.NavigateUrl   = "http://usstudentloancenter.org/";
                        e.AlternateText = "Visit Us!";
                        break;

                    case 8:
                        e.NavigateUrl   = "http://myffam.com/";
                        e.AlternateText = "We can help!";
                        break;

                    case 9:
                        e.NavigateUrl   = "http://premierstudentloancenter.com/";
                        e.AlternateText = "Find out how we can help you more!";
                        break;

                    default:
                        // Do Nothing
                        break;
                    }
                    t2 = Convert.ToString(e.ImageUrl);
                    t3 = Convert.ToInt32(t2[t2.Length - 5]) - 48;
                }
            }
        }
        if (temp == 0)
        {
            asdflist.Add(t3);
        }
    }
示例#39
0
 protected void AdRotator1AdCreated(object sender, AdCreatedEventArgs e)
 {
     e.NavigateUrl = "~/Advertiser/AdHandler.ashx?id=" + e.AdProperties["ID"].ToString();
     BannerKeywords();
 }
示例#40
0
        protected override void OnPreRender(EventArgs eee)
        {
            Hashtable ht = null;

            if (ad_file != "" && ad_file != null) {
                ReadAdsFromFile (

                    System.Web.Hosting.HostingEnvironment.MapPath(ad_file)

                );
                ht = ChooseAd ();
            }

             	AdCreatedEventArgs e = new AdCreatedEventArgs (ht);
            OnAdCreated (e);
            createdargs = e;
        }