Re: Separate folders as galleries: How to use GalleryPath

  •  01-20-2011, 9:22 PM

    Re: Separate folders as galleries: How to use GalleryPath

    Thank You Ken, but I tried this and it does not work.
     
    I created a blank asp.net page to work through this. My test folder, myPhotos, is in the root
     
    Here is the code:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@ Page Language="C#" %>
    <%@ Register TagPrefix="uc1" TagName="TopBanner" Src="banner.ascx" %>
    <%@ Register TagPrefix="DotNetGallery" Namespace="DotNetGallery" Assembly="DotNetGallery" %>

    <html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">

    <head runat="server">
     <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
     <title>Untitled 1</title>

     <script type="text/c#" runat="server">
         // Obtain the gallery folder from query string
         string album;
         void Page_Load(Object sender, EventArgs e)
         {
             album = Request.QueryString["album"];
             if (album == null || album=="/")
                 gallery1.GalleryFolder = "~/myPhotos";
             gallery1.GalleryFolder = album;
         }
     </script>

    </head>
    <body>
    <form id="form1" runat="server">
     <div>
      <uc1:topbanner ID="TopBanner1" runat="server"></uc1:topbanner>
       <div id="CommonBody" align="center">
        <dotnetgallery:gallerybrowser runat="server" id="GalleryBrowser1" Width="780" Height="400" />
       </div>
     </div>
    </form>
    </body>
    </html>
    If I remove the script then the control works and points to the default folder: GalleryFiles.
View Complete Thread