locked
Need Help with featured ads... RRS feed

  • Question

  • User-1155422150 posted

    Does anyone have any good ideas on how to multiply the featured ads control (repeater control) without getting dups?

    Thanks in advance.....

    TPD

    [Edit from moderator vcsjones: I have changed the font of your post. Please in the future use an appropriately sized font]

    Friday, March 28, 2008 7:47 PM

All replies

  • User-122480877 posted

    Hello, Yeah you could try and do this in the FeaturedAd.ascx control it self by adding another repeater or adding to the current item template and then to fight identicle duplication in the code behind with a statement to ensure the ads (adId) are not the same.

    Another option that may work could be to ad the tag uc2:FeaturedAd to the page you want to display it on and see what happens.

    Saturday, March 29, 2008 9:37 PM
  • User1128022426 posted

    If you are getting dupe ads, review the code of your Stored Proc and also make sure you dont have the same ad posted several times in the DB

    Monday, March 31, 2008 11:04 AM
  • User-1155422150 posted

    sorry if i wasn't clear, I am doing something like this... 
    some are different and some repeat...

     

        <div id="body">
            <div id="col_main_left">
                <h3>
                    Featured Listings
                </h3>
                <uc1:FeaturedAd ID="FeaturedAd" runat="server" />
                <uc1:FeaturedAd ID="FeaturedAd1" runat="server" />
                <uc1:FeaturedAd ID="FeaturedAd2" runat="server" />
                <uc1:FeaturedAd ID="FeaturedAd3" runat="server" />
                <uc1:FeaturedAd ID="FeaturedAd4" runat="server" />
            </div>
            <div id="col_main_right">
                <h1 class="section" style="text-align: center">
                    Welcome.........</h1>
                <div class="content_right">
                    <center>
                        <table id="listing_in_main">
                            <tr>
                            <th colspan="2"><h3>Featured Listings</h3></th>
                            </tr>
                            <tr>
                                <td>
                                    <uc1:FeaturedAd ID="FeaturedAd5" runat="server" />
                                </td>
                                <td>
                                    <uc1:FeaturedAd ID="FeaturedAd6" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <uc1:FeaturedAd ID="FeaturedAd8" runat="server" />
                                </td>
                                <td>
                                    <uc1:FeaturedAd ID="FeaturedAd10" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <uc1:FeaturedAd ID="FeaturedAd7" runat="server" />
                                </td>
                                <td>
                                    <uc1:FeaturedAd ID="FeaturedAd9" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <uc1:FeaturedAd ID="FeaturedAd11" runat="server" />
                                </td>
                                <td>
                                    <uc1:FeaturedAd ID="FeaturedAd12" runat="server" />
                                </td>
                            </tr>                    
                        </table>
     

     

    SP picks up random ads, and no dups in DB... but how do i make the copy of controls know they are using the same ad as the other control and should ignore them and move to the next?
    It would be great if someone can post a code example. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
    
     
    Monday, March 31, 2008 8:15 PM
  • User1128022426 posted

    Thats not very slick... :)

    Just use ONE instance of the featuredAd user control....and inside that control do you logic to retrieve more than ONE fetured ad.....maybe via a repeater or a a dataview...

     

    Tuesday, April 1, 2008 9:49 AM
  • User-1155422150 posted

    ehhehehe slick... yeah well, just wanted a “quick fix solution” but I guess, I might as well go that route...  write a new control ….

    Thanks

    Tuesday, April 1, 2008 2:41 PM