welcome Netizen

Share Your Knowledge.It is a way to achieve immortality

Wednesday, February 16, 2011

How to rotate the ads without refreshing the page by using Adrotator in Ajax....

hi ..Create your own add in your webpage..
In this article i describe about ,how to display the ads in webpage by using adrotator,
By using AJAX without refreshing the whole page you can easily display the diffrent ads in the particular area....
Intially the ads are stored in xml file ..
First you have to create the xml file for ads.

<AlternateText>This is Sample image</AlternateText>
<AlternateText>This is Sample image</AlternateText>

and save it advertisement.xml

Next create an new applications

In this adrotator->>you can finthis one in toolbox
Add Script Manage and timer
and add update panel
In this adrotator properties you can add the advertisement xml file
And also  set the time for rotating the ad in the timer control

Your code should be like this....

 <asp:scriptmanager ID="Scriptmanager1" runat="server"></asp:scriptmanager>
    <asp:Timer ID="Timer1" Interval="2000" runat="Server">
<asp:UpdatePanel ID="updatepanel1" runat="Server">
<asp:AsyncPostBackTrigger ControlID="Timer1" Eventname="Tick" />

    <asp:AdRotator ID="AdRotator2" runat="server" DataSourceID="XmlDataSource2" />
    <asp:XmlDataSource ID="XmlDataSource2" runat="server" DataFile="~/Advertisements.xml">

Your add should be like this ..........


Post a Comment