help ads Google...

Last post 01-21-2008 10:25 PM by chetan.sarode. 2 replies.

Sort Posts:

  • help ads Google...

    01-21-2008, 2:24 PM
    • Member
      point Member
    • pedro.duraes
    • Member since 01-21-2008, 7:17 PM
    • Posts 2

     Hello, I am having problems with ads google + scriptmanager. I would like the google ads to appear in an asp: panel ... Someone knows how to do?

    I tried the code below, but not satisfied ...

     

    string scriptsAds;
            scriptsAds = " <script type=\"text/javascript\">";
            scriptsAds = " google_ad_client = \"pub-5171562616796034\";";
            scriptsAds += "google_ad_width = 728;";
            scriptsAds += "google_ad_height = 90;";
            scriptsAds += "google_ad_format = \"728x90_as\";";
            scriptsAds += "google_cpa_choice = \"CAEaCKx8D4vNnKGYUEdQrgFQBVANUAg\";";
            scriptsAds += "</script>";

            //scriptsAds += "<script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">"; ;

            scriptsAds += "<script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">";


            ScriptManager.RegisterClientScriptBlock(this.FindControl("MyPanel"), this.GetType(), "AdsGoogle", scriptsAds, true);

    Filed under: , ,
  • Re: help ads Google...

    01-21-2008, 5:10 PM
    • Star
      13,595 point Star
    • gt1329a
    • Member since 06-23-2002, 8:53 PM
    • Atlanta
    • Posts 2,248
    • ASPInsiders
      TrustedFriends-MVPs
    Why not put the <script> tags inside the panel declaratively?  Are you trying to rotate the ads during partial postbacks or something?
    Encosia - ASP.NET, jQuery, AJAX, and more.

    Latest article: Emulate ASP.NET validation groups with jQuery validation
  • Re: help ads Google...

    01-21-2008, 10:25 PM
    Answer

    ScriptManager.RegisterClientScriptBlock(this.FindControl("MyPanel"), this.GetType(), "AdsGoogle", scriptsAds, true)

    the last value i.e. boolean value indicates whether to enclose the script block in <script> tags.

    You already inlcluded that tag so try with false, or remove this first line

    http://asp.net/AJAX/Documentation/Live/mref/M_System_Web_UI_ScriptManager_RegisterClientScriptBlock_5_d03cd23f.aspx

    Chetan Sarode
    Software Engineer,
    Approva Systems Pvt Ltd,
    Pune, India.
Page 1 of 1 (3 items)