It can be done currently. The problem is in using a DataList for display. The categories are all there just not shown. You have to explicitly add a repeater control for each category level you want to expose. For example, in the /Controls/CategoryBrowse.ascx
file you can add the following (see part marked "new" and please excuse poor formatting) to expose a 3rd level:
In the code behind add the following to support the new declarative syntax added.
protected void NestedSubCategoryRepeater_ItemDataBound(object sender,
RepeaterItemEventArgs e)
{
if (e.Item.ItemType ==
ListItemType.Item | e.Item.ItemType ==
ListItemType.AlternatingItem)
{
ObjectDataSource nestedDS = e.Item.FindControl("NestedCategoryDS2")
as ObjectDataSource;
CachedCategory parentCategory = e.Item.DataItem
as CachedCategory;
nestedDS.SelectParameters[0].DefaultValue = parentCategory.IdString;
}
}
This is probably one of many ways to do it.
[This posting is provided "AS IS" with no warranties, and confers no rights.]
This is a bug and to fix it go to App_Data -> CLASSIFIEDSDB.mdf -> Stored Procedure -> InsertPhoto, and change the last statement 'Return @Id)'by 'SELECT
@Id AS [Id] '.
This allows to retrieve the real Id instead of 0 (null), so it can store the real photo name under 'Upload' folder.
When I am in the "My Ads" page, with approval enabled for ads, and click on "Ads awaiting approval" or my inactive ads, both dosplay the wrong info. The awaiting aproval shows My Current Ads and Inactive Ads shows inactive ads and ads awaiting approval.
Also, the user I created via the ASP.NET admin site can't post Ads, but other users can.
Finally, if I select an ad to be a favoured ad, via the search intereface in Site Administration, it does not appear on the home page, on the LHS, where I think it is supposed to.
Small things, and otherwise a fantasic time saver and learning tool, thanks MS!
When I am in the "My Ads" page, with approval enabled for ads, and click on "Ads awaiting approval" or my inactive ads, both dosplay the wrong info. The awaiting aproval shows My Current Ads and Inactive Ads shows inactive ads and ads awaiting approval.
Also, the user I created via the ASP.NET admin site can't post Ads, but other users can.
Finally, if I select an ad to be a favoured ad, via the search intereface in Site Administration, it does not appear on the home page, on the LHS, where I think it is supposed to.
Small things, and otherwise a fantasic time saver and learning tool, thanks MS!
marcgel
Member
405 Points
76 Posts
Microsoft
Re: categaries layers and users management
Jun 10, 2006 12:56 AM|LINK
It can be done currently. The problem is in using a DataList for display. The categories are all there just not shown. You have to explicitly add a repeater control for each category level you want to expose. For example, in the /Controls/CategoryBrowse.ascx file you can add the following (see part marked "new" and please excuse poor formatting) to expose a 3rd level:
<%
@ Control Language="C#" CodeFile="CategoryBrowse.ascx.cs" 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") %>) <!-- new:: added OnItemDataBound hookup here-->
<asp:Repeater ID="NestedSubCategoryRepeater" Runat="server"
DataSourceID="NestedCategoryDS"
OnItemCommand="NestedSubCategoryRepeater_ItemCommand"
OnItemDataBound="NestedSubCategoryRepeater_ItemDataBound">
<HeaderTemplate><ul>
</HeaderTemplate>
<ItemTemplate>
<li>
<asp:LinkButton ID="SubCategoryButton" Runat="server" Text='<%# Eval("Name") %>'
CommandArgument='<%# Eval("Id") %>' />
(<%# Eval("NumActiveAds") %>)
</li> <!-- new part -->
<asp:Repeater ID="NestedSubCategoryRepeater2" runat="server"
OnItemCommand="NestedSubCategoryRepeater_ItemCommand"
DataSourceID="NestedCategoryDS2">
<HeaderTemplate><ul>
</HeaderTemplate>
<ItemTemplate>
<li>
<asp:LinkButton ID="SubCategoryButton2" runat="server"
Text='<%# Eval("Name") %>' CommandArgument='<%# Eval("Id") %>' />
</li>
</ItemTemplate>
<FooterTemplate></ul>
</FooterTemplate>
</asp:Repeater>
<asp:ObjectDataSource ID="NestedCategoryDS2" TypeName="AspNet.StarterKits.Classifieds.Web.CategoryCache"
SelectMethod="GetBrowseCategoriesByParentId" Runat="server">
<SelectParameters>
<asp:Parameter Type="Int32" Name="parentCategoryId"></asp:Parameter>
</SelectParameters>
</asp:ObjectDataSource>
<!-- end new part -->
</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>
In the code behind add the following to support the new declarative syntax added.
protected void NestedSubCategoryRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e){
if (e.Item.ItemType == ListItemType.Item | e.Item.ItemType == ListItemType.AlternatingItem)
{
ObjectDataSource nestedDS = e.Item.FindControl("NestedCategoryDS2") as ObjectDataSource;
CachedCategory parentCategory = e.Item.DataItem as CachedCategory;
nestedDS.SelectParameters[0].DefaultValue = parentCategory.IdString;
}
} This is probably one of many ways to do it.
fulltronic
Member
25 Points
7 Posts
Re: Delete Photo Files on Admin
Jun 12, 2006 05:09 PM|LINK
This is a bug and to fix it go to App_Data -> CLASSIFIEDSDB.mdf -> Stored Procedure -> InsertPhoto, and change the last statement 'Return @Id)'by 'SELECT @Id AS [Id] '.
This allows to retrieve the real Id instead of 0 (null), so it can store the real photo name under 'Upload' folder.
fulltronic.
marcgel
Member
405 Points
76 Posts
Microsoft
Re: Delete Photo Files on Admin
Jun 13, 2006 12:23 AM|LINK
sep1008,
Could you describe the scenario that a Uri was/is used to delete an image?
Thanks.
stephenc
Member
10 Points
2 Posts
Functionality bugs
Jun 16, 2006 12:53 PM|LINK
When I am in the "My Ads" page, with approval enabled for ads, and click on "Ads awaiting approval" or my inactive ads, both dosplay the wrong info. The awaiting aproval shows My Current Ads and Inactive Ads shows inactive ads and ads awaiting approval.
Also, the user I created via the ASP.NET admin site can't post Ads, but other users can.
Finally, if I select an ad to be a favoured ad, via the search intereface in Site Administration, it does not appear on the home page, on the LHS, where I think it is supposed to.
Small things, and otherwise a fantasic time saver and learning tool, thanks MS!
stephenc
Member
10 Points
2 Posts
Re: Another Bug Founded
Jun 16, 2006 12:54 PM|LINK
When I am in the "My Ads" page, with approval enabled for ads, and click on "Ads awaiting approval" or my inactive ads, both dosplay the wrong info. The awaiting aproval shows My Current Ads and Inactive Ads shows inactive ads and ads awaiting approval.
Also, the user I created via the ASP.NET admin site can't post Ads, but other users can.
Finally, if I select an ad to be a favoured ad, via the search intereface in Site Administration, it does not appear on the home page, on the LHS, where I think it is supposed to.
Small things, and otherwise a fantasic time saver and learning tool, thanks MS!
fulltronic
Member
25 Points
7 Posts
Email Notification Bug
Jun 19, 2006 06:08 PM|LINK
In order to email notification works, please make this change:
App_Code ->BLL -> Maintenance.cs (Line 46)
Change: 'list.Append(";");' by 'list.Append(",");'
Remember to modify Web.config with your own configuration.
Fulltronic.
netnow
Member
45 Points
9 Posts
Re: categaries layers and users management
Jun 21, 2006 03:30 PM|LINK
I am trying to allow javascript when adding ads in the description text box
<script src=www.mysite.com></script>
Does anyone know how to do this?
marcgel
Member
405 Points
76 Posts
Microsoft
Re: advanced search Bug Founded
Jun 29, 2006 12:29 AM|LINK
Kadjiokou
Participant
1432 Points
326 Posts
Re: Another Bug Founded
Jul 01, 2006 02:38 PM|LINK
Hi P.
To add more Adv Type you may add more items in the enum :
public enum AdType
{
Unspecified = 0,
ForSale = 1,
Wanted = 2
}
becomes ----->
public enum AdType
{
Unspecified = 0,
ForSale = 1,
Wanted = 2,
NewAdType=3
}
found in Ads.cs.
You will then want to to do " project search" for the pattern ".AdType" and do the required changes.
Thanks
/Kadji
an an
Member
70 Points
14 Posts
Re: advanced search Bug Founded
Jul 03, 2006 07:13 AM|LINK
marcgel
i tested it several times on advanced search page:
when i search by "date" , it gave me all the posts which were posted from beginning time to now , not limited by the "date" that i specified.
same as the other.