EASY! How to get rid of ad count? Turn "Cars (3)" into just "Cars"

Last post 06-27-2009 6:25 AM by Greengrass001. 13 replies.

Sort Posts:

  • EASY! How to get rid of ad count? Turn "Cars (3)" into just "Cars"

    05-03-2007, 12:27 PM
    • Member
      351 point Member
    • pedewede
    • Member since 10-27-2005, 5:37 AM
    • CA
    • Posts 95

    Easy one for you....

     How to turn off the ad count in the category. For example: Cars (3)

    I want to get rid of the (3) and just show Cars as the category without the number of car ads.

    Peter LeBlanc
    A Birdzee Creator
    www.birdzee.com or www.housecalltech.com
    Mobile: (209)518-4623
    peter@birdzee.com

  • Re: EASY! How to get rid of ad count? Turn "Cars (3)" into just "Cars"

    05-03-2007, 1:58 PM
    • Star
      7,715 point Star
    • jeremyh
    • Member since 01-23-2003, 12:14 PM
    • York, England
    • Posts 1,380
    Edit CategoryBrowse.ascx and remove

    (<%

    # Eval("NumActiveAds") %>)

     

    Regards
    Jeremy
    If this has helped Please: Don't forget to click "Mark as Answer" on the post that helped you.
    That way future readers will know which post solved your issue.
  • Re: EASY! How to get rid of ad count? Turn "Cars (3)" into just "Cars"

    05-03-2007, 4:25 PM
    • Member
      351 point Member
    • pedewede
    • Member since 10-27-2005, 5:37 AM
    • CA
    • Posts 95
    Thanks Jermy. I had to remove it in two places. It works flawlessly.
    Peter LeBlanc
    A Birdzee Creator
    www.birdzee.com or www.housecalltech.com
    Mobile: (209)518-4623
    peter@birdzee.com

  • Re: EASY! How to get rid of ad count? Turn "Cars (3)" into just "Cars"

    05-04-2007, 1:15 PM
    • Member
      131 point Member
    • Paul44
    • Member since 05-13-2006, 3:58 PM
    • Posts 50

    Which two (2) places?

    Thanks,

    Paul

     

  • Re: EASY! How to get rid of ad count? Turn "Cars (3)" into just "Cars"

    05-04-2007, 4:37 PM
    • Member
      351 point Member
    • pedewede
    • Member since 10-27-2005, 5:37 AM
    • CA
    • Posts 95

    (<%

    # Eval("NumActiveAds") %>)

    <asp:Repeater ID="NestedSubCategoryRepeater" Runat="server" DataSourceID="NestedCategoryDS"

    OnItemCommand="NestedSubCategoryRepeater_ItemCommand">

    <HeaderTemplate><ul>

    </HeaderTemplate>

    <ItemTemplate>

    <li>

    <asp:LinkButton ID="SubCategoryButton" Runat="server" Text='<%# Eval("Name") %>'

    CommandArgument='<%# Eval("Id") %>' />

    (<%

    # Eval("NumActiveAds") %>)
    Peter LeBlanc
    A Birdzee Creator
    www.birdzee.com or www.housecalltech.com
    Mobile: (209)518-4623
    peter@birdzee.com

  • Re: EASY! How to get rid of ad count? Turn "Cars (3)" into just "Cars"

    06-22-2009, 12:46 AM

    I did exactly as described, but it didn't work for me.  How come?  What am I not doing?

  • Re: EASY! How to get rid of ad count? Turn "Cars (3)" into just "Cars"

    06-22-2009, 6:21 AM
    • Star
      7,715 point Star
    • jeremyh
    • Member since 01-23-2003, 12:14 PM
    • York, England
    • Posts 1,380

    Can you post your CategoryBrowse.ascx here, so we can take a look and maybe offer more help.

    Is this local copy or working on a hosted system?

     

    Regards
    Jeremy
    If this has helped Please: Don't forget to click "Mark as Answer" on the post that helped you.
    That way future readers will know which post solved your issue.
  • Re: EASY! How to get rid of ad count? Turn "Cars (3)" into just "Cars"

    06-22-2009, 6:30 AM

    Here is my CategoryBrowse.ascx

     

    <%@ Control Language="VB" CodeFile="CategoryBrowse.ascx.vb" Inherits="CategoryBrowse_ascx" %>

    <asp:DataList ID="TopCategoryList" Runat="server" DataSourceID="TopCategoriesDS" CssClass="category_browse" HorizontalAlign="Center"

    RepeatColumns="2" OnItemDataBound="TopCategoryList_ItemDataBound" OnItemCommand="TopCategoryList_ItemCommand">

    <ItemStyle VerticalAlign="Top" HorizontalAlign="Left">

    </ItemStyle>

    <ItemTemplate>

    <h4>

    <asp:LinkButton ID="TopCategoryButton" Runat="server" Text='<%# Eval("Name") %>'

    CommandArgument='<%# Eval("Id") %>' />

    </h4>

    (<%# Eval("NumActiveAds") %>)

    <asp:Repeater ID="NestedSubCategoryRepeater" Runat="server" DataSourceID="NestedCategoryDS"

    OnItemCommand="NestedSubCategoryRepeater_ItemCommand">

    <HeaderTemplate><ul>

    </HeaderTemplate>

    <ItemTemplate>

    <li>

    <asp:LinkButton ID="SubCategoryButton" Runat="server" Text='<%# Eval("Name") %>'

    CommandArgument='<%# Eval("Id") %>' />

    (<%# Eval("NumActiveAds") %>)</li></ItemTemplate>

    <FooterTemplate></ul></FooterTemplate>

    </asp:Repeater>

    <asp:ObjectDataSource ID="NestedCategoryDS" TypeName="AspNet.StarterKits.Classifieds.Web.CategoryCache"

    SelectMethod="GetBrowseCategoriesByParentId" Runat="server">

    <SelectParameters>

    <asp:Parameter Type="Int32" Name="parentCategoryId"></asp:Parameter>

    </SelectParameters>

    </asp:ObjectDataSource>

    </ItemTemplate>

    </asp:DataList>

    <asp:ObjectDataSource ID="TopCategoriesDS" Runat="server" TypeName="AspNet.StarterKits.Classifieds.Web.CategoryCache"

    SelectMethod="GetBrowseCategoriesByParentId">

    <SelectParameters>

    <asp:Parameter Type="Int32" DefaultValue="0" Name="parentCategoryId"></asp:Parameter>

    </SelectParameters>

    </asp:ObjectDataSource>

  • Re: EASY! How to get rid of ad count? Turn "Cars (3)" into just "Cars"

    06-22-2009, 6:55 AM
    • Star
      7,715 point Star
    • jeremyh
    • Member since 01-23-2003, 12:14 PM
    • York, England
    • Posts 1,380

    Ok change the file to look like this and save the file then review the page in your browser.

     

    <%@ Control Language="VB" CodeFile="CategoryBrowse.ascx.vb" Inherits="CategoryBrowse_ascx" %>
    <asp:DataList ID="TopCategoryList" Runat="server" DataSourceID="TopCategoriesDS" CssClass="category_browse" HorizontalAlign="Center"
    RepeatColumns="2" OnItemDataBound="TopCategoryList_ItemDataBound" OnItemCommand="TopCategoryList_ItemCommand">
    <ItemStyle VerticalAlign="Top" HorizontalAlign="Left">
    </ItemStyle>
    <ItemTemplate>
    <h4>
    <asp:LinkButton ID="TopCategoryButton" Runat="server" Text='<%# Eval("Name") %>'
    CommandArgument='<%# Eval("Id") %>' />
    </h4>
    <asp:Repeater ID="NestedSubCategoryRepeater" Runat="server" DataSourceID="NestedCategoryDS"
    OnItemCommand="NestedSubCategoryRepeater_ItemCommand">
    <HeaderTemplate><ul>
    </HeaderTemplate>
    <ItemTemplate>
    <li>
    <asp:LinkButton ID="SubCategoryButton" Runat="server" Text='<%# Eval("Name") %>'
    CommandArgument='<%# Eval("Id") %>' />
    </li></ItemTemplate>
    <FooterTemplate></ul></FooterTemplate>
    </asp:Repeater>
    <asp:ObjectDataSource ID="NestedCategoryDS" TypeName="AspNet.StarterKits.Classifieds.Web.CategoryCache"
    SelectMethod="GetBrowseCategoriesByParentId" Runat="server">
    <SelectParameters>
    <asp:Parameter Type="Int32" Name="parentCategoryId"></asp:Parameter>
    </SelectParameters>
    </asp:ObjectDataSource>
    </ItemTemplate> 
    </asp:DataList>
    <asp:ObjectDataSource ID="TopCategoriesDS" Runat="server" TypeName="AspNet.StarterKits.Classifieds.Web.CategoryCache"
    SelectMethod="GetBrowseCategoriesByParentId">
    <SelectParameters>
    <asp:Parameter Type="Int32" DefaultValue="0" Name="parentCategoryId"></asp:Parameter>
    </SelectParameters> 
    </asp:ObjectDataSource>
    
     Hope it helps
    Regards
    Jeremy
    If this has helped Please: Don't forget to click "Mark as Answer" on the post that helped you.
    That way future readers will know which post solved your issue.
  • Re: EASY! How to get rid of ad count? Turn "Cars (3)" into just "Cars"

    06-22-2009, 7:08 AM

    I get the error message:

     

    Server Error in '/starter kit' Application.

    Compilation Error

    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

    Compiler Error Message: BC30560: 'controls_featuredad_ascx' is ambiguous in the namespace 'ASP'.

    Source Error:

    Line 34:     <div id="body">
    Line 35:         <div id="col_main_left">
    Line 36:             <uc1:FeaturedAd ID="FeaturedAd" Runat="server" />
    Line 37:             <div id="announcements">
    Line 38:                 <ul>

    Source File: D:\Store\Website\starter kit\Default.aspx    Line: 36

  • Re: EASY! How to get rid of ad count? Turn "Cars (3)" into just "Cars"

    06-22-2009, 9:17 AM
    • Star
      7,715 point Star
    • jeremyh
    • Member since 01-23-2003, 12:14 PM
    • York, England
    • Posts 1,380

    Ok so did you make any changes to the default.aspx or the FeaturedAd.ascx ?

    Regards
    Jeremy
    If this has helped Please: Don't forget to click "Mark as Answer" on the post that helped you.
    That way future readers will know which post solved your issue.
  • Re: EASY! How to get rid of ad count? Turn "Cars (3)" into just "Cars"

    06-23-2009, 1:43 AM

    I got it working. Thanks a bunch for your help!  By the way, do you know how to get rid of the subcategoriies from showing up.  I know  it has to do something with the deleting theNestedSubCategory.  Can you help?

  • Re: EASY! How to get rid of ad count? Turn "Cars (3)" into just "Cars"

    06-26-2009, 11:27 AM
    • Star
      7,715 point Star
    • jeremyh
    • Member since 01-23-2003, 12:14 PM
    • York, England
    • Posts 1,380

    Glad you got it working.

    If you are wanting to remove the sub Category from the categoryBrowse.ascx
    then take a look at removing the nested repeater from the control.

      <asp:Repeater ID="NestedSubCategoryRepeater" Runat="server" DataSourceID="NestedCategoryDS"
                OnItemCommand="NestedSubCategoryRepeater_ItemCommand">
                <HeaderTemplate><ul>
                </HeaderTemplate>
                <ItemTemplate>
                    <li>
                    <asp:LinkButton ID="SubCategoryButton" Runat="server" Text='<%# Eval("Name") %>'
                        CommandArgument='<%# Eval("Id") %>' />
                    (<%# Eval("NumActiveAds") %>)</li></ItemTemplate>
                <FooterTemplate></ul></FooterTemplate>
            </asp:Repeater>


     

    Hope it helps

    Regards
    Jeremy
    If this has helped Please: Don't forget to click "Mark as Answer" on the post that helped you.
    That way future readers will know which post solved your issue.
  • Re: EASY! How to get rid of ad count? Turn "Cars (3)" into just "Cars"

    06-27-2009, 6:25 AM

     Got it!  You are a superstar! 

     

     

Page 1 of 1 (14 items)