I think in page /Web_code/WebFeatureCache.VB you can specificy the maxNumAds by changing the number in bold as shown below.
However, I don't know why asp:repeater in default.aspx doesn't parse all 3 feature ads, it only displays 1 ad.
Private Shared Function FetchFeaturedAd() As CachedFeaturedAd
Dim feature As CachedFeaturedAd = Nothing
Dim table As AdsDataComponent.AdsDataTable = AdsDB.GetFeaturedAdsSelection(3) <---
If Not (table Is Nothing) AndAlso table.Rows.Count > 0 Then
Dim featuredAd As AdsDataComponent.AdsRow = CType(table.Rows(0), AdsDataComponent.AdsRow)
feature = New CachedFeaturedAd(featuredAd.Id, featuredAd.PreviewImageId, featuredAd.Title, featuredAd.Description)
End If
akent
Member
142 Points
32 Posts
Mutliple Featured Ads on Homepage
Sep 09, 2006 04:51 PM|LINK
Has anyone figured out how to best extend the current featured ad functionality to showcase say n amount of ads on the homepage?
scokim
Member
190 Points
52 Posts
Re: Mutliple Featured Ads on Homepage
Sep 11, 2006 06:23 AM|LINK
I think in page /Web_code/WebFeatureCache.VB you can specificy the maxNumAds by changing the number in bold as shown below.
However, I don't know why asp:repeater in default.aspx doesn't parse all 3 feature ads, it only displays 1 ad.
Private Shared Function FetchFeaturedAd() As CachedFeaturedAd
Dim feature As CachedFeaturedAd = Nothing
Dim table As AdsDataComponent.AdsDataTable = AdsDB.GetFeaturedAdsSelection(3) <---
If Not (table Is Nothing) AndAlso table.Rows.Count > 0 Then
Dim featuredAd As AdsDataComponent.AdsRow = CType(table.Rows(0), AdsDataComponent.AdsRow)
feature = New CachedFeaturedAd(featuredAd.Id, featuredAd.PreviewImageId, featuredAd.Title, featuredAd.Description)
End If
Return feature
End Function
End Class
akent
Member
142 Points
32 Posts
Re: Mutliple Featured Ads on Homepage
Sep 11, 2006 06:09 PM|LINK
hmm, yeah the asp:repeater is implemented in Controls/FeaturedAd.asxc and the FeaturedAdDataSource seens alright? Perhaps a problem with the caching?
alexschumi
Member
5 Points
1 Post
Re: Mutliple Featured Ads on Homepage
Sep 11, 2006 08:07 PM|LINK
akent
Member
142 Points
32 Posts
Re: Mutliple Featured Ads on Homepage
Sep 11, 2006 10:29 PM|LINK
strange i rewrote it to the following:
public static DataTable GetFeaturedAd()
{
DataTable AdsDataComponentAdsDataTable = AdsDB.GetFeaturedAdsSelection(3);
AdsDataComponentAdsDataTable.Columns["id"].ColumnName = "AdID";
return AdsDataComponentAdsDataTable;
}
And i set a breakpoint, but no matter what AdsDataComponentAdsDataTable will always only contain 1 row ?
akent
Member
142 Points
32 Posts
Re: Mutliple Featured Ads on Homepage
Sep 11, 2006 10:30 PM|LINK
strange i rewrote it to the following:
public static DataTable GetFeaturedAd()
{
DataTable AdsDataComponentAdsDataTable = AdsDB.GetFeaturedAdsSelection(3);
AdsDataComponentAdsDataTable.Columns["id"].ColumnName = "AdID";
return AdsDataComponentAdsDataTable;
}
And i set a breakpoint, but no matter what AdsDataComponentAdsDataTable will always only contain 1 row ?
scokim
Member
190 Points
52 Posts
Re: Mutliple Featured Ads on Homepage
Sep 13, 2006 12:28 AM|LINK
The solution can be found here
http://forums.asp.net/thread/1327721.aspx