473,782 Members | 2,534 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exteding the AdRotator Control and Advert.xml file to track advertstats

MC
I've been using the ASP.NET ad rotator for some time and have been asked
to track the hits and click thrus, The solution that seemed obvious to
me was to extend the existing control to record the Display count and
then rewrite the URL location to be passed as a paramter to a page which
records the click count and redirect to the intended page.

This all seems to work fine. My next thought was that the most logical
location for the Click and Display count was in the Ads.xml file used to
control the AdRotator. This works however, I get Errors because the file
is locked by the AdRotator.

I currently catch the error and continue, what would be the correct way
to deal with this situation and ensure that the hit gets recorded?
Oct 2 '07 #1
5 2249
Hi MC,

My opinion on such scenario would be to use database instead of a file to
track the click count. Just insert a record for each click and later use
"select count..." to get total click count of a specific AD.

Here's some example code for your reference:

#Superexpert - Listing 4.14 - AdRotatorTrack. aspx
http://www.superexpert.com/Books/Asp...pter4/Listing4
_14.aspx

Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 3 '07 #2
MC
True, In the past I would have agreed, however one could argue that the
XML file is a "Database" of sorts, I was trying to avoid the overheads
of another (SQL) database in my site.
The simplicity of this solution was what interested me as I already have
a sophisitcated XML file handling utility class which has meant that I
only needed to add 4 lines of code to an overriden usercontrol to
impliment the majority of the functionality.

So thanks for the Sql Solution, but I'm still interested in finding out
the recomended safe way to update the XML file that may be in use by the
AdRotator for rendering or other instances also tring to update.

Regards
Mike Caddy

Walter Wang [MSFT] wrote:
Hi MC,

My opinion on such scenario would be to use database instead of a file to
track the click count. Just insert a record for each click and later use
"select count..." to get total click count of a specific AD.

Here's some example code for your reference:

#Superexpert - Listing 4.14 - AdRotatorTrack. aspx
http://www.superexpert.com/Books/Asp...pter4/Listing4
_14.aspx

Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.
Oct 3 '07 #3
MC
True, In the past I would have agreed, however one could argue that the
XML file is a "Database" of sorts, I was trying to avoid the overheads
of another (SQL) database in my site.
The simplicity of this solution was what interested me as I already have
a sophisitcated XML file handling utility class which has meant that I
only needed to add 4 lines of code to an overriden usercontrol to
impliment the majority of the functionality.

So thanks for the Sql Solution, but I'm still interested in finding out
the recomended safe way to update the XML file that may be in use by the
AdRotator for rendering or other instances also tring to update.

Regards
MC

Walter Wang [MSFT] wrote:
Hi MC,

My opinion on such scenario would be to use database instead of a file to
track the click count. Just insert a record for each click and later use
"select count..." to get total click count of a specific AD.

Here's some example code for your reference:

#Superexpert - Listing 4.14 - AdRotatorTrack. aspx
http://www.superexpert.com/Books/Asp...pter4/Listing4
_14.aspx

Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.
Oct 3 '07 #4
Hi MC,

Even if we could update the xml file "database", there's a high chance that
we will encounter locking issues since multiple requests can take place at
the same time and they all need to write to the xml file. Note IO
operations are slow, therefore such locking and IO errors will occur very
frequently.

On the other hand, database is much better handling such concurrent
operations, especially if you're inserting two irrelevant new records
(instead of updating a single record); and database operations are much
faster than IO operations.

Hope this helps.

Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 3 '07 #5
MC
Ok, I agree, However the application is quite low traffic, I guess that
with time we will have more traffic and maybe the DB route is worth
doing now to save re-implimenting in the future, currently with the
simple "Try Catch Solution" there is about 2 IO errors a week.

Regards
MC

Walter Wang [MSFT] wrote:
Hi MC,

Even if we could update the xml file "database", there's a high chance that
we will encounter locking issues since multiple requests can take place at
the same time and they all need to write to the xml file. Note IO
operations are slow, therefore such locking and IO errors will occur very
frequently.

On the other hand, database is much better handling such concurrent
operations, especially if you're inserting two irrelevant new records
(instead of updating a single record); and database operations are much
faster than IO operations.

Hope this helps.

Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.
Oct 3 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1626
by: kdmath | last post by:
I want to use the AdRotator control to dispay pay per click ads in the banner. I am able to use the AdRotator control for other links but when I use the code that the pay per click ads say to insert in to the page, the link code that tracks the clicks does not work. Surely there is a way to use this control for these ads. Any help would be apriciated. Thanks, kdmath
5
5595
by: Erica | last post by:
My images in Adrotator are not displaying. The ALT tag only displays. My text file looks like this: redirect redirect.asp border 0 height 115 width 215 * /images/awards.swf http://www.starone-intranet.com/main.asp
0
2566
by: Erica | last post by:
Hopefully someone can offer me a workaround to this problem: I am using adRotator to rotate some reminders on my intranet site. I have a redirect page name redirect.asp that recieves the querystring variable, 'url' and redirects the user to that page. One of the reminders should be redirected to a url that contains query strings itself. The url passes in the string up to the first '&'. What should I do. Here is the code on the page...
0
3396
by: DDK | last post by:
Does anyone know if the asp.net adrotator control supports flash banners. If so, how does the XML file look with a flash banner in it. I am trying to get a .swf flash file to work with the adrotator and it doesn't seem to be displaying. I just not sure what needs to done. Any info would be much appreciated, D.
2
1739
by: Leon | last post by:
How to display flash banners using the built-in .net AdRotator control? Do I have to extend the existing AdRotator control? if so than how? If you know of any books or website that explain the above please include that information in your response .. Thanks
5
3124
by: Dan | last post by:
Hi, I created an AdRotator control with this code: <asp:AdRotator id="AdRotator1" Runat="Server" AdvertisementFile="adrotator.xml"> </asp:AdRotator> The xml file contains: <Advertisements> <Ad>
7
2490
by: Aussie Rules | last post by:
Hi, I have a adrotator control on a page, and want to program the connection of the control via SQL. I have the following code which doesn't seem to do much, and not sure what else to do? Dim SQLServerConnection As SqlConnection Dim SqlConnectionCls As New clsSQL
1
2958
by: Aussie Rules | last post by:
Hi, I have a few adrotators on a page, each bound to a sql dataset from my database The function works fine, but as we are going to charge for the advertising impression and click throughs I would like to be able to capture details about what add is displayed. The image name the adrotator is using would be good enough, but what would
0
1578
by: MC | last post by:
I have coded an AdRotator to use a Database for it's data source. If I use a SqlDataSource control it functions as expected, however if I manually retreive the data using an OleDBDataReader It always omits the first item in the result set? Code for each solution as below. The reason I'm don't want to use the Declarative solution is that I intend to Create a custom control that inherits from AdRotator and I would then need to retrieve the...
0
9641
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9944
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6735
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.