locked
Featured Ad issue on live site RRS feed

  • Question

  • User1606052502 posted

    Howsit guys, my website is live at www.classifieds4u.co.za and im having a problem with featured ad block only displaying 1 featured ad, even tho i have more than one.  

    How do i go about fixing this?

    Thanks for all the help so far on my site, its appreciated big time!

    Monday, September 21, 2009 3:40 AM

Answers

  • User-1136540166 posted

    This was answered before.  Rather than search the forum for the original thread, I will summarize here.

    (Many thanks to whoever answered this the first time, as I implemented it immediately.)


    go to directory controls and find   featuredad.ascx 

    then near the bottom of the file find a line like this:

    <asp:Parameter Type="Int32" Name="maxNumAds" DefaultValue="5" />

    You can see I changed mine to 5.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, September 26, 2009 12:29 PM

All replies

  • User730446648 posted

    Just add pictures, and set it as featured.
    That's it.

    No Pics, it won't work.

     

    Tuesday, September 22, 2009 10:17 AM
  • User1606052502 posted

    hey man, thats it, there are pics on all my featured ads. at the moment my site has 2, but on the home page it only displays one at a time, not a maximum of 5 ads on the home page under featured ad and rotates thru that, it only displays one featured ad block on the home page at a time.

    Tuesday, September 22, 2009 10:47 AM
  • User730446648 posted

    The code is simple and random, which as far as I know, nobody has shared their upgraded featured ad code.

    If you copy the code on your default page so there's two, it will display two.
    Since it is random, at times you will see the same add side by side, other times there would be to seperate ads. 

     

    Or you could look at the featuredad control where it's getting the info from.

     

    Good Luck

     

    Tuesday, September 22, 2009 9:03 PM
  • User-1136540166 posted

    This was answered before.  Rather than search the forum for the original thread, I will summarize here.

    (Many thanks to whoever answered this the first time, as I implemented it immediately.)


    go to directory controls and find   featuredad.ascx 

    then near the bottom of the file find a line like this:

    <asp:Parameter Type="Int32" Name="maxNumAds" DefaultValue="5" />

    You can see I changed mine to 5.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, September 26, 2009 12:29 PM
  • User-1758080400 posted

    New here.

    My featuredad.ascx does not have that line. I assume i have a slightly different version. I tried adding the code and making some adjustments but still getting errors. 

    Would it be possible for you to post the .ascx and the .cs

     

    Thanks

     

    Monday, March 15, 2010 3:24 PM
  • User-1136540166 posted

    in directory controls, this is featuredad.ascx   - I am now showing 7 featured ads so they run down the whole left side of my growing site.

    <%@ Control Language="VB" CodeFile="FeaturedAd.ascx.vb" Inherits="FeaturedAd_ascx" %>
    <asp:Repeater ID="FeaturedAd" runat="server" DataSourceID="FeaturedAdDataSource">
        <ItemTemplate>
            <div id="featured_item">
                <%--this control was changed so that 3 featured ads are shown on the default page.
                2008-11-10 I changed it from 4 to 7 featured ads as the site has grown a lot :-) 
                This solution was found at http://forums.asp.net/t/1001971.aspx?PageIndex=3--%>
                <a id="content_start"></a>
                <h2>
                    Featured</h2>
                <p>
                    <asp:HyperLink ID="PhotoLink" runat="server" NavigateUrl='<%# Eval("Id", "~/ShowAd.aspx?id={0}") %>'><img src='<%# Eval("PreviewImageId", "PhotoDisplay.ashx?photoid={0}&size=medium") %>' alt="Featured Image" style="border:0;" /></asp:HyperLink></p>
                <p>
                    <asp:HyperLink ID="TitleLink" runat="server" Text='<%# Eval("Title") %>' NavigateUrl='<%# Eval("Id", "~/ShowAd.aspx?id={0}") %>'></asp:HyperLink></p>
            </div>
        </ItemTemplate>
    </asp:Repeater>
    <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="7" />
    
    </SelectParameters>
    
    </asp:ObjectDataSource> 



    and this is featuredAd.ascx.vb - I do not remember ever modifying this file - and I don't see any comments in it that I did

    Imports System
    Imports System.Web.UI.WebControls
    
    Partial Class FeaturedAd_ascx
    	Inherits System.Web.UI.UserControl
    
    	Protected Sub FeaturedAdDataSource_Selected(ByVal sender As Object, ByVal e As ObjectDataSourceStatusEventArgs)
    
    		Me.Visible = Not (e.ReturnValue Is Nothing)
    
    	End Sub
    
    End Class


    Monday, March 15, 2010 7:59 PM
  • User-1758080400 posted

    Thanks so much.

    Placed all of the missing lines and it works great.

    Hope I can help in the future.

     

    Wednesday, March 17, 2010 10:23 PM