Wednesday, January 19, 2011

AdRotator Using Ajax Timer Control

Dear Googler,
        This is my First Post in my Blog. Here I post, How to use Ajax Timer Control in AdRotator.
We are all know, in the AdRotator Web Server Control need a XML file. So first we create a XML file. here is the Syntax



Syntax:

ads.xml

<?Xml version="1.0" encoding="utf-8"?>
<Advertisements>
<Ad>
<ImageUrl>~/images/sample.jpg</ImageUrl>
<NavigateUrl>http://www.google.com</NavigateUrl>
<AlternateText>This is Sample image</AlternateText>
<Impressions>40</Impressions>
<Keyword>small</Keyword>
<width>300</width>
<Height>50</Height>
</Ad>



<Ad>
<ImageUrl>~/images/sample1.jpg</ImageUrl>
<NavigateUrl>http://www.yahoo.com</NavigateUrl>
<AlternateText>This is Sample image</AlternateText>
<Impressions>40</Impressions>
<Keyword>small</Keyword>
<width>300</width>
<Height>50</Height>
</Ad>
</Advertisements>

Default.aspx:

<asp:Timer ID="Timer1" Interval="2000" runat="Server">
</asp:Timer>
<asp:UpdatePanel ID="up1" runat="Server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" Eventname="Tick" />
</Triggers
<Content Template>
<asp:AdRotator ID="AdRotator1" AdvertisementFile="~/ads.xml" keywordFilter="small" runat="Server"/>
 </ContentTemplate>
</asp:UpdatePanel>

8 comments:

  1. Excellent Blog Submitted by MR.Prakash MCA...

    Your Starting is Good and Do well Achieve more

    Regards
    N.Ravindran

    ReplyDelete
  2. Nice Sir its so useful to other developers....
    Lets I hope to you add some other useful new techniques in .net....
    All The Best ...


    With Regards
    Agasaravanan.J MCA

    ReplyDelete
  3. Good work from prakash...comprehensive plan to help to others keep it up.....you are supposed to encourage one another from this blog....

    ReplyDelete
  4. Its wonderful work... It is useful for us.. we are expecting like such a kind of blogs... Do wel..

    ReplyDelete
  5. Your blog turned my face from FaceBook. We are following... Give your Best...

    ReplyDelete
  6. hai Sir.,

    Your codes very useful to me and now i need the detailed code for user name check availability from database.

    I hope you will post earlier as possible .

    ReplyDelete
  7. hai anna i want a detail about .how to use more pages in windows application in c#.net...by gunasekaran final mca in bharathidasan university (butp)...our last dot net batch student

    ReplyDelete
  8. This is best one article so far I have read online. I would like to appreciate you for making it very simple and easy. I have found another nice post related to this post over the internet which also explained very well. For more details you may check it by visiting this url........
    http://mindstick.com/Articles/385ebacd-89e2-40d3-868a-0185e7c45f15/?ASP.Net%20AJAX%20Server%20Control:%20Timer

    Thanks

    ReplyDelete