Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

AJAX Slideshow extender on Master Page

$
0
0

Problem is That if i use the same code in simple web form it runs correctly and if i am using it with master pages it is not Hapenning at all

This Is my Code Behind Page 

Imports System.IO
Imports AjaxControlToolkit
Imports System.Web.Services
Imports System.Web.Script.Services
Imports System.Collections.Generic
Public Class VDNMain
Inherits System.Web.UI.MasterPage

<WebMethod()>
<ScriptMethod()>
Public Shared Function GetImages() As Slide()
Dim slides As New List(Of Slide)()
Dim sPath As String = HttpContext.Current.Server.MapPath("~/sliderimages/")
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

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
End Class

and In my Master Page i have this code from front 

<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager>
<asp:Image ID="SliderImage" runat="server" Width="100%" Height="200px" />
<ajaxToolkit:SlideShowExtender ID="SlideShowExtender1" runat="server" TargetControlID="SliderImage"
PlayInterval="1000" Loop="true" AutoPlay="true" SlideShowServiceMethod="GetImages"
SlideShowServicePath="~/default.aspx" >
</ajaxToolkit:SlideShowExtender>


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>