Hi amw123,
Please test the example below, it will shows you how many images in each category.
- <%@ Page Language="C#" %>
-
- <%@ Register TagPrefix="DotNetGallery" Namespace="DotNetGallery" Assembly="DotNetGallery" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
- <script runat="server">
- protected override void OnLoad(EventArgs e)
- {
- using (DotNetGallery.GalleryDataProvider provider = DotNetGallery.GalleryDataProvider.CreateInstance(Context, "~/GalleryFiles/"))
- {
-
- string[] categoryArray = provider.GetCategoryArray();
-
- for (int i = 0; i < categoryArray.Length; i++)
- {
- string[] photoArray = provider.GetPhotoArray(categoryArray[i]);
- label1.Text += "There is : " + photoArray.Length.ToString() + " images in category" + i.ToString() + "</br>";
- }
-
- }
- base.OnLoad(e);
- }
- </script>
-
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title>Untitled Page</title>
- </head>
- <body>
- <form id="form1" runat="server">
- <asp:Label ID="label1" runat="server"></asp:Label>
- <DotNetGallery:GalleryBrowser ID="galleryBrowser1" runat="server" AllowEdit="true" />
- </form>
- </body>
- </html>
Regards,
ken