Hello reader,
I use Visual Studio 2010 and ASP.NET 4.0 and code in vb. I have created a website with a master page and have installed a SlideShow Extender on it. Default.aspx uses this master page and has no contents, but the slideshow doesn't work at all and the error I get is SCRIPT5007: Unable to get value of the property 'ui': object is null or undefined
and the problem is on the line:
$create(Sys.Extended.UI.SlideShowBehavior, {"autoPlay":true,"id":"Image4_SlideShowExtender","imageHeight":200,"imageWidth":0,"loop":true,"playInterval":1500,"slideShowAnimationType":7,"slideShowServiceMethod":"GetSlides","slideShowServicePath":"SlideService.asmx"}, null, null, $get("Image4"));
The SlideShow Extender doesn't work at all, only the first image shows up and then the error comes up. I don't know if the problem is in the code or there must be a link in the master page's code. Any ideas? Thanks in advance.
Master Page
<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body bgcolor="#000000">
<form id="form1" runat="server" style="background-color: #000000">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div class ="Image" >
<asp:Image ID="Image4" runat="server" Height="200"
ImageUrl="~/SlideImages/soccer_banner1_ok.png" />
</div>
<asp:SlideShowExtender ID="Image4_SlideShowExtender" runat="server"
AutoPlay="True" Enabled="True" Loop="True" SlideShowAnimationType="SlideDown"
TargetControlID="Image4"
SlideShowServiceMethod="GetSlides"
SlideShowServicePath="SlideService.asmx"
PlayInterval="1500"></asp:SlideShowExtender>
</div>
</form>
</body>
</html>
App_Code/SlideService.vb
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
<System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class SlideService
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function GetSlides() As AjaxControlToolkit.Slide()
Dim MySlides(1) As AjaxControlToolkit.Slide
MySlides(0) = New AjaxControlToolkit.Slide("../SlideImages/soccer_banner1_ok.png", "", "")
MySlides(1) = New AjaxControlToolkit.Slide("../SlideImages/The-Beauty-of-Soccer_ok.png", "", "")
Return MySlides
End Function
End Class
SlideService.asmx
<%@ WebService Language="VB" CodeBehind="~/App_Code/SlideService.vb" class="SlideService" %>
Default.aspx
<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="True" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>
Default.aspx.vb
Partial Class _Default
Inherits System.Web.UI.Page
End Class