locked
SlideShowExtender on MasterPage RRS feed

  • Question

  • User1856414974 posted

    Hello!

    I'm very new to AJAX but I wanted to put a slideshowextender on my master page and at the same time load automaticaly the files from a specific folder. 

    I got this code on my WebServices:

    <WebMethod(true)> _
        <System.Web.Script.Services.ScriptMethod> _
        Public Function GetSlides() As AjaxControlToolkit.Slide()
            Dim NomeImagens As String() = Nothing
            Dim Caminho As String = ""
            Try
                NomeImagens = System.IO.Directory.GetFiles(HttpContext.Current.Server.MapPath("~") & "Imagens\Parceiros")
    
                If NomeImagens.Length = 0 Then Return Nothing
    
                Dim Imagens(NomeImagens.Length - 1) As AjaxControlToolkit.Slide
    
                For i As Integer = 0 To NomeImagens.Length - 1
                    Dim Ficheiro() As String = NomeImagens(i).Split("\")
                    Imagens(i) = New AjaxControlToolkit.Slide(HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) & "/Imagens/Parceiros/" & Ficheiro(Ficheiro.Length - 1), Ficheiro(Ficheiro.Length - 1), "")
                Next
                Return Imagens
        End Function

    And this code into a Div:

    <asp:Image ID="image1" runat="server" Width="100%" Height="100%" />
                               <cc1:SlideShowExtender ID="SlideShowExtender1" runat="server" TargetControlID="image1" ContextKey="~\Imagens\Parceiros\" AutoPlay="true" Loop="true" SlideShowServicePath="~/WebServices/WebServiceImagens.asmx" SlideShowServiceMethod="GetImages"></cc1:SlideShowExtender>
    

    It doesnt work at all. I made a new project but instead of using it on a masterpage a used a WebForms and that worked. Is there something I'm missing to have it working on the master page?

    Thursday, July 30, 2015 1:54 PM

Answers

  • User2103319870 posted

    SlideShowServiceMethod="GetImages"

    Not sure if this is a type, but You have your method name in WebService declared as GetSlides and in the SlideShowExtender you are using GetImages method. Try changing it to GetSLides like below

    <asp:image id="image1" runat="server" width="100%" height="100%" />
    <cc1:slideshowextender id="SlideShowExtender1" runat="server" targetcontrolid="image1"
        contextkey="~\Imagens\Parceiros\" autoplay="true" loop="true" slideshowservicepath="~/WebServices/WebServiceImagens.asmx"
        slideshowservicemethod="GetSlides"></cc1:slideshowextender>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 30, 2015 9:03 PM
  • User177399542 posted

    Hi Batto

                     The error states that you are using multiple Ajax control toolkit Toolkitscriptmanager tags in your page. There is no need to use multiple toolkitscriptmanager tags while using Ajax control toolkit controls. Remove extra tags. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 4, 2015 12:24 AM

All replies

  • User2103319870 posted

    SlideShowServiceMethod="GetImages"

    Not sure if this is a type, but You have your method name in WebService declared as GetSlides and in the SlideShowExtender you are using GetImages method. Try changing it to GetSLides like below

    <asp:image id="image1" runat="server" width="100%" height="100%" />
    <cc1:slideshowextender id="SlideShowExtender1" runat="server" targetcontrolid="image1"
        contextkey="~\Imagens\Parceiros\" autoplay="true" loop="true" slideshowservicepath="~/WebServices/WebServiceImagens.asmx"
        slideshowservicemethod="GetSlides"></cc1:slideshowextender>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 30, 2015 9:03 PM
  • User61956409 posted

    Hi Batto,

    Batto

    Public Function GetSlides() As AjaxControlToolkit.Slide()

    Batto

    SlideShowServiceMethod="GetImages"

    Firstly, as a2h said, please make sure if the name of your slideshowservicemethod is correct.

    Secondly, you could set breakpoint in your WebServices method to check if the method could be called by slideshowextender.

    Best Regards,

    Fei Han

    Friday, July 31, 2015 2:56 AM
  • User1856414974 posted

    Oh I took notice of that as I posted this post, I fixed it but it still doesn't work. I tried debugger but somehow it doesnt "pass" there.

    This also shows sometimes but I've changed the ID's and it still keeps doing that. If I comment the one he's giving error he just goes for the next one.

    Friday, July 31, 2015 4:49 AM
  • User177399542 posted

    Hi Batto

                     The error states that you are using multiple Ajax control toolkit Toolkitscriptmanager tags in your page. There is no need to use multiple toolkitscriptmanager tags while using Ajax control toolkit controls. Remove extra tags. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 4, 2015 12:24 AM