Last post Sep 12, 2007 12:26 PM by rfurdzik
Oct 05, 2006 12:59 AM|paggy4u|LINK
I will be oblidged, if some one can help me out with a solution for this.
Currently i have only one Featured Item available.
I need to show atleast 2 -or 3 on the same page.
I also need to make one featured item as fixed and other two as random.
But.... The problem is.... Since the featured items are generated randomly, it is also possible the
random advt may display the same featured item as shown as a fixed item.
In such cases, there will be 2 same items or perhaps 3 same
items on the same page.
Oct 06, 2006 06:36 AM|Kadjiokou|LINK
MarcGel has suggested a very elegant solution in an earlier post. You still have to fix the random problem.
You control the amount of featured adds displayed using <asp:parameter/> of the objectDatasource.
Oct 07, 2006 12:05 AM|paggy4u|LINK
Could you kindly provide me the libk to Marcgel solution/thread.
Unfortunately i have not seen it so far.
Oct 07, 2006 08:58 AM|Kadjiokou|LINK
look at the thread:
there you will find
The kit was designed to pick one of 1 or more cached feature ads and show that. Your approach for showing a specified number of ads will work. If I were going to add the feature I would consider using the the generic List<> and duplicating the structure
of the existing methods to get the benefits of caching:
DisplayCount could be passed in <asp:Parameter> from FeatureAd.ascx ObjectDataSource. Otherwise FeatureAd.asc would stay the same.
Oct 16, 2006 03:59 AM|yayayo08|LINK
Do you have any VB code solution? of the FeaturedCache.vb?
Aug 26, 2007 12:22 AM|rfurdzik|LINK
Aug 27, 2007 12:56 PM|darkknight187|LINK
But it still has the random function, I too am looking for a solution for going through a list of featuredads and then starting over.
If I find it before you do, I'll post back here.
To see what I did go to www.detelli.com/Featured.aspx
Aug 27, 2007 02:35 PM|rfurdzik|LINK
That is exactly what I did, but this is not good as the same ad can appear more than once... I think I have an idea:
1) Load all featured ads recordset to some session variable, lets call it FeaturedDS
2) Have the featured ads based on recordset FeaturedDS, however once the ad is dsiplayed remove thsi record from FeaturedDS
3) Once getting data (reading data method), check if FeaturedDS has any records, if no records Requery the FeaturedDS against the original stored procedure (repopulate that recordset). If empty again (means no featured in db), show no featured ads...
Do you think you can start with the code and post it here your progress? We can make it like a msall open source sub-project:) I am willing to help. Let's try to work this out together. What do you think?
Here is my website: www.zikbay.com
Sep 12, 2007 12:26 PM|rfurdzik|LINK
Ok I think I found the solution for multiple Featured. It will come from one recordset:
1) For each time featured ad is displayed on the page update classifieds_ads. Increase new field: FeaturedDisplyedCount= FeaturedDisplyedCount + 1
2) Have the recordset for deatured be based on the following SQL:
Select * from Classifieds_Ads Order By FeaturedDisplyedCount ASC
3) To spice things up, we can Add Weight field (values from 1 -10) to classifieds_ads. The new SQL would be:
Select * from Classifieds_Ads Order By FeaturedDisplyedCount * (1-(Weight-1)/100) ASC)
4) Now here I have some problem. How do I display 6 featured based on this new recordset. My layout needs to be like this (of course featured custim control needs to be replaced with some Item template...):