hi raneamey,
Please try the example below. It shows you how to get the physical path and virtual path of the categories.
- <%@ Page Language="C#" %>
-
- <%@ Register TagPrefix="DotNetGallery" Namespace="DotNetGallery" Assembly="DotNetGallery" %>
-
- <script runat="server">
- void Page_Load(object sender, EventArgs e)
- {
- using (DotNetGallery.GalleryDataProvider provider = DotNetGallery.GalleryDataProvider.CreateInstance(Context, "~/GalleryFiles/"))
- {
-
- string[] categoryArray = provider.GetCategoryArray();
- for (int i = 0; i < categoryArray.Length; i++)
- {
- string title;
- string description;
- string properties;
- string physicalPath = provider.PhysicalDirectory;
- string virtualPath = provider.VirtualDirectory;
-
- if (provider.GetCategoryInfo(categoryArray[i].ToString(), out title, out description, out properties))
- {
-
-
- string s = "Category " + i.ToString() + " physical path: " + physicalPath + title+"<br/>";
- label1.Text += s;
- string s2 = "Category " + i.ToString() + " virtual path: " + virtualPath + title + "<br/>";
- label1.Text += s2;
- }
- }
- }
- }
-
- </script>
-
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head id="Head1" runat="server">
- <title></title>
- </head>
- <body>
- <form id="form1" runat="server">
- <asp:Label ID="label1" runat="server"></asp:Label>
- <DotNetGallery:GalleryBrowser runat="server" ID="gallery1" Width="720" Height="430" />
- </form>
- </body>
- </html>
Regards,
ken