[quote user="jherch77"]Well, I figured out what seems to be the easiest solution to this...albeit not the best. I changed the following function to what is below:
Public Shared Function GetFeaturedAd()
As DataTable
Dim table As AdsDataComponent.AdsDataTable = AdsDB.GetFeaturedAdsSelection(3)
Return table
End Function
And in the control FeaturedAd.ascx I changed everything that said AdID with Id.
Public Shared Function GetFeaturedAd() As DataTable Dim table As AdsDataComponent.AdsDataTable = AdsDB.GetFeaturedAdsSelection(3) Return table End Function i would like to know exactly where to put this in the file, ine the vb file or the aspx file, and
where, thank you for your advice and help
Public Shared Function GetFeaturedAd() As DataTable Dim table As AdsDataComponent.AdsDataTable = AdsDB.GetFeaturedAdsSelection(3) Return table End Function i would like to know exactly where to put this in the file, ine the vb file or the aspx file, and
where, thank you for your advice and help
Well, I figured out what seems to be the easiest solution to this...albeit not the best. I changed the following function to what is below:
Public Shared Function GetFeaturedAd()
As DataTable
Dim table As AdsDataComponent.AdsDataTable = AdsDB.GetFeaturedAdsSelection(3)
Return table
End Function
And in the control FeaturedAd.ascx I changed everything that said AdID with Id.
paggy4u
Contributor
3017 Points
774 Posts
Re: Only one featured add?
Sep 13, 2006 05:49 AM|LINK
[quote user="jherch77"]Well, I figured out what seems to be the easiest solution to this...albeit not the best. I changed the following function to what is below:
Public Shared Function GetFeaturedAd() As DataTable
Dim table As AdsDataComponent.AdsDataTable = AdsDB.GetFeaturedAdsSelection(3)
Return table
End Function
And in the control FeaturedAd.ascx I changed everything that said AdID with Id.
That made my 3 ads show up.
---------------------------------------------------------------------------------------------------------
Hello Can any one come ahead with an exact solution to make this work.
I do not understand how to make this work as per the code mentioned above. Does it really work or thiere is a bug within.
Since this was before the Final Kit, i believe, there should be an exact solution by now.
Help us out.
Thanks
-----------------------------------------
Working with Dynamic Languages
tonsai
Member
417 Points
89 Posts
Re: Only one featured add?
Sep 13, 2006 10:12 AM|LINK
paggy4u
Contributor
3017 Points
774 Posts
Re: Only one featured add?
Mar 14, 2007 07:46 AM|LINK
I still cannot show 3 featured ads on the front page.
I would appreciate, if some one can help[ me out with a working solution with cache in VB.NET.
Thanks
-----------------------------------------
Working with Dynamic Languages
rfurdzik
Contributor
3439 Points
1731 Posts
Re: Only one featured add?
Jul 18, 2007 07:18 AM|LINK
What changes are required to CSS to show 3 ads horizontally. I have added#featured_item
{
float: left; ...}
But that makes next section to follow the featured ads...
Buy Sell Domains - DomainsHeat.com
Free ASP.NET controls: Youtube Web Control and Ajax Zoom Control
domukajoor
Member
13 Points
6 Posts
Re: Only one featured add?
Jul 24, 2007 11:41 PM|LINK
Where is located that function you are talking about?
thanks
r1kob
Member
48 Points
20 Posts
Re: Only one featured add?
Jul 27, 2007 02:29 PM|LINK
Public Shared Function GetFeaturedAd() As DataTable Dim table As AdsDataComponent.AdsDataTable = AdsDB.GetFeaturedAdsSelection(3) Return table End Function i would like to know exactly where to put this in the file, ine the vb file or the aspx file, and where, thank you for your advice and help
r1kob
Member
48 Points
20 Posts
Re: Only one featured add?
Jul 27, 2007 02:31 PM|LINK
Public Shared Function GetFeaturedAd() As DataTable Dim table As AdsDataComponent.AdsDataTable = AdsDB.GetFeaturedAdsSelection(3) Return table End Function i would like to know exactly where to put this in the file, ine the vb file or the aspx file, and where, thank you for your advice and help
prk72
Member
36 Points
144 Posts
Re: Only one featured add?
Jul 30, 2007 08:09 PM|LINK
In which file can I find this function? Thanks.
rfurdzik
Contributor
3439 Points
1731 Posts
Re: Only one featured add?
Jul 31, 2007 02:27 AM|LINK
This solution is not the best, yet it works. It would be nice if somebody would show the complete cached code....
Here is the quick and dirty solution for now. This is in Ads.cs (appdata folder)
public static AdsDataComponent.AdsDataTable GetFeaturedAdsSelection(int maxNumAds){
if (maxNumAds < 1) return null; using (AdsDataAdapter db = new AdsDataAdapter()){
return db.GetAdsByRandomOrder(maxNumAds, (int)AdStatus.Activated, (int)AdLevel.Featured);}
}
here is your featured.ascx page:<
asp:ObjectDataSource ID="FeaturedAdDataSource" runat="server" TypeName="AspNet.StarterKits.Classifieds.BusinessLogicLayer.AdsDB" SelectMethod="GetFeaturedAdsSelection" OnSelected="FeaturedAdDataSource_Selected"> <SelectParameters> <asp:Parameter Type="Int32" Name="maxNumAds" DefaultValue="3" />
</SelectParameters>Buy Sell Domains - DomainsHeat.com
Free ASP.NET controls: Youtube Web Control and Ajax Zoom Control
rfurdzik
Contributor
3439 Points
1731 Posts
Re: Only one featured add?
Jul 31, 2007 02:30 AM|LINK
The problem with thsi solution is that you are bypassing cache code, so please somebody provide the complete C# cache code for us:)
Otherwise i am going to write it :) Hope somebody will save my time :)
Buy Sell Domains - DomainsHeat.com
Free ASP.NET controls: Youtube Web Control and Ajax Zoom Control