I am trying to use the SlideShowExtender in toolkit and I get the following error.
An unhandled exception occurred:
Message: Unknown web method GetSlides.
Parameter name: methodName
Stack Trace:
at System.Web.Script.Services.WebServiceData.GetMethodData(String methodName)
at System.Web.Script.Services.RestHandler.CreateHandler(WebServiceData webServiceData, String methodName)
at System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)
at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Below is my markup and webmethod
<asp:Image ID="ImgSlide" runat="server" Height="300" Width="300" /><ajaxToolkit:SlideShowExtender ID="SlideShowExtender1" runat="server"
TargetControlID="ImgSlide"
SlideShowServiceMethod="GetSlides"
SlideShowServicePath="~/WebServiceImages.asmx"
AutoPlay="True"
PlayInterval="1000" />
Imports System.IO
Imports AjaxControlToolkit
Imports System.Web.Services
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
<System.Web.Script.Services.ScriptService()><WebService(Namespace:="http://tempuri.org/")><WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)><Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Public Class WebServiceImages
Inherits System.Web.Services.WebService<WebMethod()>
Public Shared Function GetSlides() As Slide()
Dim slides As New List(Of Slide)()
Dim sPath As String = HttpContext.Current.Server.MapPath("~/ketodocs/slides/")
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
End Class