Topbar
Topbar
Sign in
|
Join
|
Client Center
Home
Products
Client Center
Contact
Purchase
Support forums
»
Products
»
ASP.Net Image Gallery
»
How to display only certain categories / + ability to list available categories
How to display only certain categories / + ability to list available categories
Last post 08-03-2011, 7:14 AM by
Kenneth
. 5 replies.
Sort Posts:
Oldest to newest
Newest to oldest
Previous
Next
07-30-2011, 3:36 PM
69067
rmw82
Joined on 04-06-2011
Posts 3
How to display only certain categories / + ability to list available categories
Reply
Quote
Is there a way to display only certain categories?
It would also be nice to be able to generate a list of available categories so I can create links to pages that would only show those pictures within that particular category.
Thanks,
Rob
08-01-2011, 7:52 AM
69115
in reply to
69067
Kenneth
Joined on 02-13-2008
Posts 3,886
Re: How to display only certain categories / + ability to list available categories
Reply
Quote
Hi rmw82,
Please try property "CategoryID ".
GalleryBrowser1.CategoryID = "1";
Regards,
ken
08-01-2011, 2:41 PM
69140
in reply to
69115
rmw82
Joined on 04-06-2011
Posts 3
Re: How to display only certain categories / + ability to list available categories
Reply
Quote
Thanks, Ken.
Is there anyway to get a list of the available categories so I can dynamically list them and create links to each category?
Thanks again,
Rob
08-02-2011, 10:47 AM
69171
in reply to
69140
Kenneth
Joined on 02-13-2008
Posts 3,886
Re: How to display only certain categories / + ability to list available categories
Reply
Quote
Hi rmw82,
Try
using (DotNetGallery.GalleryDataProvider provider = DotNetGallery.GalleryDataProvider.CreateInstance(Context, "~/GalleryFiles/"))
{
//get all category
string[] categoryArray = provider.GetCategoryArray();
for (int i = 0; i < categoryArray.Length; i++)
{
//get id of all categories
//categoryArray[i] is the category id
label1.Text += categoryArray[i];
}
}
Regards,
ken
08-02-2011, 2:49 PM
69182
in reply to
69171
rmw82
Joined on 04-06-2011
Posts 3
Re: How to display only certain categories / + ability to list available categories
Reply
Quote
Ken,
I appreciate your responses. It seems that this will give me the ID numbers of the categories, which I need in order to filter the categories. Is there an easy way to also retrieve the Category name?
Thanks again,
Rob
08-03-2011, 7:14 AM
69216
in reply to
69182
Kenneth
Joined on 02-13-2008
Posts 3,886
Re: How to display only certain categories / + ability to list available categories
Reply
Quote
Hi rmw82,
Please try
using (DotNetGallery.GalleryDataProvider provider = DotNetGallery.GalleryDataProvider.CreateInstance(Context, "~/GalleryFiles/"))
{
//get all category
string[] categoryArray = provider.GetCategoryArray();
for (int i = 0; i < categoryArray.Length; i++)
{
string title;
string description;
string properties;
if (provider.GetCategoryInfo(categoryArray[i].ToString(), out title, out description, out properties))
{
//title is the name of the category
label1.Text += title;
}
}
}
Regards,
ken