Change banner to each page refresh

5

I have a list with 3 Banners .

I always have to show a different one every Refresh from Page , even after closing the browser.

I'm thinking of doing a counter of impressions every time a Banner is shown adds + 1 to the counter and I make this check whenever it shows.

But if you have 2 Banners registered and after several impressions a third party is registered would break this scheme, because only the last one to be registered would be shown.

Does anyone suggest another way?

    
asked by anonymous 20.05.2014 / 00:38

1 answer

2

I'm assuming your Banner is in a list of Banners, something like List<Banner> :

banners.ElementAt(new Random().Next(0, banners.Count));
    
20.05.2014 / 00:43