Buenas, soy nuevo en Ajax.
El problema es que no logro insertar un control del tipo SlideShowExtender en un UserControl
Hay alguna restriccióo o limitación en esto?
Si lo inserto dentro de una página funciona, si no me sale una caja de texto de windows con un error que no encuentra el método que le asigno en el método SlideShowServiceMethod
El error exacto es
[El server method 'GetSlideRecent' failed with the folowing error:
Unknown web method GetSlideRecent. <br> Parameter name: methodName.....]
Les paso todo el código por si acaso, cualquier sugerencia o comentarios son bienvenidos.
Un saludo
-------------------------------------------------------------------------------------------------------
-----------------------------
SLIDESHOW1.ASCX
-----------------------------
<%@ Control Language="vb" AutoEventWireup="false" Explicit="True"
Inherits="GlobalStudio.Modules.Itinerario.SlideSho w1"
CodeFile="SlideShow1.ascx.vb" %>
<div style="text-align: center">
<asp:Label ID="lblTest" runat="server" Text="Label"></asp:Label>
<asp:Image ID="imgPicture" runat="server" Height="240" Style="border: 3px
solid black;
width: auto" ImageUrl="~/images/SlideShow/1.jpg" />
<asp:Label runat="Server" ID="lblDescripcion" /><br />
<br />
<asp:Button runat="Server" ID="prevButton" Text="Prev" Font-Size="smaller"
/>
<asp:Button runat="Server" ID="playButton" Text="Play" Font-Size="smaller"
/>
<asp:Button runat="Server" ID="nextButton" Text="Next" Font-Size="smaller"
/>
<ajaxToolkit:SlideShowExtender
ID="SlideShowExtenderRecent"
runat="server"
TargetControlID="imgPicture"
SlideShowServiceMethod="GetSlidesRecent"
AutoPlay="true"
ImageDescriptionLabelID="lblDescripcion"
NextButtonID="nextButton"
PlayButtonText="Play"
StopButtonText="Stop"
PreviousButtonID="prevButton"
PlayButtonID="playButton"
PlayInterval="7000"
Loop="true">
</ajaxToolkit:SlideShowExtender>
</div>
-----------------------------
SLIDESHO1.ASCX.VB
-----------------------------
Imports DotNetNuke
Imports DotNetNuke.UI
Imports DotNetNuke.UI.Utilities
Imports DotNetNuke.Entities.Modules
Imports DotNetNuke.Entities.Modules.Actions
Imports DotNetNuke.UI.WebControls
Namespace GlobalStudio.Modules.Itinerario
Partial Class SlideShow1
Inherits Entities.Modules.PortalModuleBase
#Region "Event Handlers"
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Try
Dim myHelloWorld As New GetPhotos
Dim sReturn As String = myHelloWorld.HelloWorld()
lblTest.Text = sReturn
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
#End Region
End Class
End Namespace
-----------------------------
GETPHOTOS.ASMX
-----------------------------
<%@ WebService Language="VB" CodeBehind="~/App_Code/GetPhotos.vb"
Class="GetPhotos" %>
-----------------------------
GETPHOTOS.VB
-----------------------------
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Web.Script.Services
Imports System.IO
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicPr ofile1_1)> _
<ScriptService()> _
Public Class GetPhotos
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function GetSlides() As AjaxControlToolkit.Slide()
Return BuildArray("recent")
End Function
Private Function BuildArray(ByVal SlideShowName As String) As
AjaxControlToolkit.Slide()
'PhotosPath is the path to (and including) the images folder of my
application
Dim strPath =
CStr(System.Configuration.ConfigurationManager.App Settings("PhotosPath")) &
SlideShowName
Dim files As String()
Dim File As String
files = IO.Directory.GetFiles(strPath, "*")
Dim arySlides(files.Length - 1) As AjaxControlToolkit.Slide
Dim intX As Integer = 0
For Each File In files
'strip off everything before images to create a relative path to image file
File = File.Remove(0, 27)
File = File.Replace("\", "/")
Dim objSlide As New AjaxControlToolkit.Slide
objSlide.ImagePath = File
objSlide.Name = ""
objSlide.Description = ""
arySlides(intX) = objSlide
intX += 1
Next
Return arySlides
End Function
<WebMethod()> _
Public Function HelloWorld() As String
Return "Hello World"
End Function
<WebMethod()> _
Public Function GetSlidesRecent() As AjaxControlToolkit.Slide()
Return New AjaxControlToolkit.Slide() {New
AjaxControlToolkit.Slide("Images/SlideShow/1.jpg", "", ""), New
AjaxControlToolkit.Slide("Images/recent/p1010062.jpg", "", "")}
End Function
End Class
-------------------------------------------------------------------------------------------------------