Issue Changing Gallery Folder Multiple Times

Last post 01-16-2013, 6:37 PM by bedge20. 2 replies.
Sort Posts: Previous Next
  •  01-16-2013, 4:43 PM 76664

    Issue Changing Gallery Folder Multiple Times

    I am having an issue when rendering the image gallery multiple times with different GalleryFolders.  I have implemented the gallery inside an AJAX ModalPopupExtender on my master page.  From another page, the user clicks a link to display a particular gallery.  In the code behind on the master page I change the GalleryFolder property, and render the modal popup.  This code works fine on my local machine for an unlimited number of times.  However, when deployed on an IIS 7.0 server running .NET Runtime 4.0 the gallery stops working after the user clicks the 5th gallery link.  It displays but is empty of any images.  A few additional details:

     

    1.  The ModalPopupExtender works fine for an unlimited number of times when the Image Gallery is not included in the popup.

    2.  The ModelPopupExtender works fine for an unlimited number of times when the popup contains a YouTube video embedded as an iFrame

    Based on this, I don't believe the Modal Popup to be an issue

     

    I have implented the Image Gallery three different ways :

    a)  Directly inside a ModalPopupExtender panel as described above

    b)  As an iFrame inside the ModalPopupExtender, with a URL to another page that contains only the Image Gallery control

    c)   Using window.open() to open another page that contains only the ImageGallery control

    The same behavior exists in all three implementations.  The fact that it occurrs in options b and c really puzzles me, since it's a brand new page being loaded each time.

     

    Finally, if the same Image Gallery is rendered with the same GalleryFolder it will work an unlimited number of times.  The problem only occurrs if the gallery folder is changed.  If I refresh the page, it starts working again but will again stop after the GalleryFolder is changed 4 times.

     

    Screenshots of my client and server side code below.  Any ideas? 

     

    <asp:ModalPopupExtender ID="mpeGallery" runat="server" PopupControlID="panGallery"
                            TargetControlID="hidBtnGalleryTarget" BackgroundCssClass="modalBackground" CancelControlID="imgGalleryClose">
                        </asp:ModalPopupExtender>
                        <asp:Panel ID="panGallery" runat="server" CssClass="modalPopup" >
                            <asp:Panel ID="Panel2" runat="server" HorizontalAlign="right" BackColor="#474547">
                                <asp:ImageButton ID="imgGalleryClose" runat="server" ImageUrl="~/Images/close.png"
                                    Style="background-color: White;" OnClientClick="scrollToAnchor();" />
                            </asp:Panel>
                            <DotNetGallery:GalleryBrowser ID="imgGallery" runat="server" GalleryFolder="" Layout="Slideshow"
                                Width="900" Height="500" AllowPostComment="false" AllowShowComment="false" AllowEdit="false" />
                        <iframe id="ifrmMasterTour" class="youtube-player" type="text/html" runat="server"
                        width="800" height="450" src="" frameborder="0" visible="false" wmode="opaque"></iframe>
                        </asp:Panel>
     

     

        Protected Sub btnShowGallery_Click(sender As Object, e As System.EventArgs) Handles btnShowGallery.Click
            With Me.imgGallery
                .GalleryFolder = TTPSettings.ImageGalleryPath & Me.hidGalleryFolder.Value
                .Visible = True
                .Enabled = True
            End With


            With Me.ifrmMasterTour
                .Visible = False
                .Attributes.Add("src", "")
            End With


            Me.mpeGallery.Show()
        End Sub
     

     

     

    Filed under: ,
  •  01-16-2013, 5:42 PM 76665 in reply to 76664

    Re: Issue Changing Gallery Folder Multiple Times

    A couple of addional notes:

    1.  I am not getting any Javascirpt or sever errors

    2.  When it breaks, the <script> block that is written to the client is incomplete.  It stops immediately after "Categories;", and the <script> block is not closed, which explains why it messes up the rendering of my page.

     

    <script type='text/javascript'>var thegallerybrowser=new GalleryBrowser(
                {ClientID:'ctl00_imgGallery',UniqueID:'ctl00$imgGallery',Folder:'/CuteSoft_Client/Gallery/',LoadHandler:'Load.ashx',Theme:'Classic',Culture:'en-US',Layout:'Slideshow',Slider:'NewWin',Viewer:'LightBox',Popup:'Default',Editor:'Explorer',LogonUserID:null,LogonUserName:null,AllowEdit:null,AllowPostComment:null,AllowShowComment:null
    ,ScriptOption:{}
    ,Categories:
     

  •  01-16-2013, 6:37 PM 76666 in reply to 76664

    Re: Issue Changing Gallery Folder Multiple Times

    Well we figured it out.  We had not granted Write permission on the folder that contains the images on the IIS Server.  We copied all the images, thumbnails and all, with our code when we deployed the gallery so this didn't immediatley jump out at us as an issue.  But apparently the GalleryControl was attempting to rebulid the thumbnails, and it was failing.  What finally tipped us off is we added a new folder that didn't have any thumbnails and it wouldn't work at all.  
View as RSS news feed in XML