You must Sign In to post a response.

Adrotator

how to use adrotator in asp.net without refreshing the page
and with out using ajax
or
how to use adrotator in asp.net by refreshing the part of a page
and with out using ajax


Comments

Author: Praveen20 Apr 2009 Member Level: Gold   Points : 2

http://www.codeproject.com/KB/webforms/AdRotator_VT.aspx

http://www.w3schools.com/asp/asp_adrotator.asp

hope that will help u

Author: D.Jeya kumar(JK)20 Apr 2009 Member Level: Gold   Points : 2

Hi,


You can use java script to load the pages.but it is also has some restriction

Regards
JK

Author: archana20 Apr 2009 Member Level: Gold   Points : 2

hi,



http://www.beansoftware.com/ASP.NET-Tutorials/Use-AdRotator-Control.aspx

Author: archana20 Apr 2009 Member Level: Gold   Points : 2

hi,



http://www.experts-exchange.com/Microsoft/Development/Q_24117595.html

Author: Veeraraghavan Jeevanandam20 Apr 2009 Member Level: Gold   Points : 2

Hi,

see the below given code part,

How to Rotate Ads without Refreshing the Page using AdRotator and ASP.NET AJAX

The AdRotator control in ASP.NET is extremely handy when it comes to randomly displaying advertisements on your site. However the ads are rotated only when the user refreshes the page. In this article, we will explore how you can easily rotate ads at regular intervals, without the user refreshing the page. Follow these steps:
Step 1: Open VS 2008. Click File > New > Website. Choose ASP.NET Website from the list of installed template, choose target platform as .NET Framework 3.5, choose the desired language and enter the location where you would like to store the website on your FileSystem. I have created a folder called VS2008 Projects, so the location over here is C:\VS 2008 Projects\AdRotatorAJAX. After typing the location, click OK.
Step 2: Now you would need to create some banners images to test out the adrotator functionality. I have designed three 270 * 270 banners (dnc.jpg, ssc.jpg and writeforus.jpg) that has been attached along with the code over here. Let us add them to our project. Right click the project > New Folder > Rename it to ‘images’. Now add the 3 banners images to this project.
Step 3: The AdRotator control can retrieve the list of advertisements from either a XML file or from the database. To keep things simple, I will be using an XML file. So the next step is to create the advertisement file. I prefer to create this file in the App_Data folder as it is secure. To do so, right click the App_Data folder > Add New Item > ‘XML File’ > Rename it to ads.xml and click Add. Now add the following contents to the ‘ads.xml’ file:



~/images/dnc.jpg
http://www.dotnetcurry.com
DotNetCurry Home Page
40
small


~/images/ssc.jpg
http://www.sqlservercurry.com
SQL Server Curry Home Page
20
small


~/images/writeforus.jpg
300
50
http://www.dotnetcurry.com/writeforus.aspx
dotnetcurry.com Write For Us
40
small


Step 4: Our next step is to add the AdRotator control and bind it to the advertisement file. Drag and drop an AdRotator control from the toolbox to the Default.aspx. To bind the AdRotator to our XML file, we will make use of the ‘AdvertisementFile’ property of the AdRotator control as shown below:
id="AdRotator1"
AdvertisementFile="~/App_Data/Ads.xml"
KeywordFilter="small"
Runat="server" />
Note: The ‘KeywordFilter’ property enables you to filter advertisement using a keyword. If your Advertisement file contains different kinds of ads (banner, leaderboard, skyscraper etc.), you can use this property to filter out different ads on different sections of the page. If you observe, the ads.xml file also contains a property called ‘Keyword’ which binds that ad with the AdRotator that contains the same KeywordFilter, in our case ‘small’.
If you run the sample now, you will have to refresh the page to display a new advertisement. In the last step, let us see how to rotate the ads without refreshing the page.
Step 5: To rotate the ads without refreshing the page, we will add some AJAX code to the page. The trick is to drop the AdRotator in an UpdatePanel and then use a Timer control to refresh the contents at regular intervals. The resultant code will be as shown below:











id="AdRotator1"
AdvertisementFile="~/App_Data/Ads.xml"
KeywordFilter="small"
Runat="server" />




If you observe, we have used Triggers inside an UpdatePanel. Triggers enable the UpdatePanel to refresh its content from a control outside the UpdatePanel. In our case, the Timer control is the control outside the UpdatePanel, which updates the content of the UpdatePanel. The content here is the AdRotator control.



The Event captured is the ‘Tick’ event of the Timer control. So every time the Timer control raise a tick event, an async postback occurs and the contents of the UpdatePanel is refreshed and that is how you are able to see the AdRotator control refresh its content at regular intervals.
So that was a quick tip on how to rotate ads using the AdRotator at regular intervals without refreshing the page. The source code of the article can be downloaded from here. I hope this article was useful and I thank you for viewing it.

Hope this will helps to you..........

Author: Yogesh20 Apr 2009 Member Level: Gold   Points : 2

Hi,

Use Ajax timer control and trigger the ad rotator with asynchronous postback.


Warm regards,
Yogesh