Tips / ASP Ad Rotator Control
Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.
Learn More
Subtitles of the Movie
In this movie, let's talk about some more ASP elements, the Ad Rotator Control. Basically this will allow us to easily display advertisement on our ASP web pages. The control displays the graphic we supply like a GIF image, then when they click the ad their redirected to a specific website that we specify. We can have a list of different ads in the data source for the page to receive. The control randomly selects an ad each time the page is refreshed. You can weigh the priority level of the banners to make certain that ads are displayed more often then others, like on impressions. That's the impression you can increase that so that certain ads are displayed more then others. The ads that are in your banner basically are in the rotation come from various sources. They come from XML files typically but they can also come from like a SQL or an Access Database. Let me show you how to do it with an XML file. Right here I just copied in the basic help code for an XML file with an Ad Rotator, I made an XML file and I copied this in here. Right here is the advertisements information, here is the beginning of an ad, here's the image URL, here's where it's located and the ad. Here's where you can navigate to it, right here we could change obviously, make it go to a completely different website, whatever I need to put in there I can change the code. I can have text there so that if it doesn't pop up I can type it in. Right here I can have a different ad pop up if I want to and we'll have banner 3 pop up. And of course here's another ad, it starts again, the URL alternate and then here's our impressions, how often do you want it to show up compared to the other ones. So that's simply all it is. That's your XML file for those banner ads. You can go to the Help Menu and get this little test item really easy and copy the code in there to work with it. You can also go online, there's all kinds of little codes that you can out in there to make it work. Now, if you have your XML file what you do now is simply add that to your ASP page. So let's go to our ASP page here and we've got one. What we do on the standard controls is grab this ad rotator, pull it in there. Then what we have to do is refer it to our source. So we go to new data source and it's going to be an XML file and now we need to browse for it. So let's go back here and save our page and now it will let us choose our data source. Let's choose browse, I have an ads XML file that I created, I'll click OK and now let's save this and let's preview it. Right there my ad popped up and you'll notice it got a link on it because if I click that link and I had it go to CNN and there it is. Banner ads are really easy to create and then to ad them to a Rotator Control, it doesn't get any easier then this. Basically take your XML file and then simply add that Ad Rotator within the ASP.Net Controls and you'll have a rotation and you can sell those ads and have the impression level basically set so that different people can pay different costs. You can also use that Ad Rotator for yourself, have different things run through about your company and about your place, so that you can easily advertise different things without doing a whole lot of work. So take a minute, go look up your XML Ad Rotator, when you go into the Help Menu just type in Ad Rotator, I'll include the ads XML file in your work files so you can have that if you want to. Take that and then tweak it in the source code to fit your website and then run it, see if you can make that Ad Rotator work.
Tutorial Information
| Course: | Microsoft Expression Web 2 |
| Author: | Melanie Hedgespeth |
| SKU: | 33908 |
| ISBN: | 1-934743-94-1 |
| Release Date: | 2008-08-28 |
| Duration: | 8 hrs / 122 lessons |
| Work Files: |
Yes |
| Captions: | Available on CD and Online University |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 98,729 Video Tutorials (23,265 free)
- Video Available as Flash or QuickTime
- Over 1026 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 