locked
Slideshow not working with Master/content page RRS feed

  • Question

  • User-1809947162 posted

    I am having difficulty getting the Slideshow to work.  Here's my situation: -

    I have a master page and content page.  On the content page I have the ToolkitScriptManager, an AnimationExtender which works perfectly, and a SlideShowExtender that doesn't.

    The SlideShowExtender is defined: -
        <ajaxToolkit:SlideShowExtender ID="SlideShowExtender1" runat="server" TargetControlID="imgSlideshow"
            SlideShowServiceMethod="GetImages" AutoPlay="true" ImageTitleLabelID="lblClick"
            Loop="true" PlayInterval="1000" ImageDescriptionLabelID="lblImageDescription">
        </ajaxToolkit:SlideShowExtender>

    In the CodeBehind: GetImages is defined: -
        <WebMethod()> _
        <ScriptMethod()> _
        Public Shared Function GetImages() As Slide()
            Dim slides As New List(Of Slide)()
            Dim sPath As String = HttpContext.Current.Server.MapPath("~/gdbmstr/Slideshow")
            If sPath.EndsWith("\") Then
                sPath = sPath.Remove(sPath.Length - 1)
            End If
            Dim pathUri As New Uri(sPath, UriKind.Absolute)
            Dim files As String() = Directory.GetFiles(sPath)
            For Each file As String In files
                Dim filePathUri As New Uri(file, UriKind.Absolute)
                slides.Add(New Slide() With { _
                  .Name = Path.GetFileNameWithoutExtension(file), _
                  .Description = Path.GetFileNameWithoutExtension(file) + " Description.", _
                  .ImagePath = pathUri.MakeRelativeUri(filePathUri).ToString() _
                })
            Next
            Return slides.ToArray()
        End Function

    If I put a checkpoint on the statement Return slides.ToArray() then I can see that slides contains exactly what I expect.   Continuing to step through the code with F10, immediately on exiting from the function an error is thrown:    Call Stack location: AjaxControlToolkit.DLL!AjaxControlToolkit.Slide.ImagePath.get() line 49
    (No source available, so the rest of the debugger output isn't worth copying).

    I've tried this, but it didn't make any difference: -
    1.  Adding buttons etc so that my code exactly matches the sample
    2.  Refreshing my Ajax toolkit by downloading a later version for VS2010 ASP.NET V4.0 (which is what I use)
    3.  I've searched this forum for SlideShow and tried any likely looking fix to reported problems

    Thank you, Robert Barnes.

    Saturday, March 14, 2015 8:52 PM

Answers