Hi,
I've been trying to get the SlideShowExtender working ... The module seems to retrieve the image data from the web service, but the image doesn't get updated... The image just stays the same. I built a non DNN web application with the control and it worked fine.
This code is taken from the SlideShowExtender tutorial on asp.net
Partial rendering is not checked.
Anyone got some clues? I would love to see this working!
Here is the code:
file: DesktopModules/Slideshow/SlideShowControl.ascx.cs
using
System;
using
DotNetNuke;
using
DotNetNuke.Common;
using
DotNetNuke.Security.Roles;
using
DotNetNuke.Security.Membership;
using
System.Collections.Generic;
using
DotNetNuke.Entities;
using
DotNetNuke.Services.Exceptions;
using
System.Collections;
using
DotNetNuke.Entities.Users;
using
System.Web.UI;
using
System.Web.UI.WebControls;
namespace
{
DotNetNuke.Modules.AJAXControlToolkitpublic partial class AJAXControlToolkit : DotNetNuke.Entities.Modules.PortalModuleBase
{
{
{
DotNetNuke.Framework.
protected void Page_Load(object sender, EventArgs e)if (DotNetNuke.Framework.AJAX.IsInstalled())AJAX.RegisterScriptManager();// Create a reference to the Script Manager
ScriptManager objScriptManager = ScriptManager.GetCurrent(this.Page);// Add a reference to the web service
objServiceReference.Path =
objScriptManager.Services.Add(objServiceReference);
ServiceReference objServiceReference = new ServiceReference();@"~/DesktopModules/SlideShow/SlideShowService.asmx";//ScriptReference objScriptReference = new ScriptReference();
//objScriptReference.Path = @"~/DesktopModules/AjaxWebService/CallWebServiceMethods.js";
//objScriptManager.Scripts.Add(objScriptReference);
}
}
}
}
file: DesktopModules/Slideshow/SlideShowControl.ascx
@ Control Language="C#" AutoEventWireup="true" CodeFile="SlideShowControl.ascx.cs"
<%
Inherits="DotNetNuke.Modules.AJAXControlToolkit.AJAXControlToolkit" %>@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<
<
<
<
<
<
<
<
<
<
br />asp:Image ID="Image1" runat="server" Height="316px" Width="388px"ImageUrl="~/DesktopModules/SlideShow/images/Sunset.jpg" /><br />br />asp:Label ID="lblImageDescription" runat="server" /><br />br />asp:Button ID="Btn_Previous" runat="server" Text="Previous" />asp:Button ID="Btn_Next" runat="server" Text="Next" Width="64px" /><br />br />asp:Button ID="Btn_Play" runat="server" Text="Play" /><br />cc1:SlideShowExtender ID="SlideShowExtender1" AutoPlay="true" ImageDescriptionLabelID="lblImageDescription"
Loop="true" NextButtonID="Btn_Next" PlayButtonID="Btn_Play" PlayButtonText="Play"
PreviousButtonID="Btn_Previous" SlideShowServiceMethod="GetSlides" StopButtonText="Stop"
</
TargetControlID="Image1" runat="server" SlideShowServicePath="SlideShowService.asmx">cc1:SlideShowExtender>
file: DesktopModules/Slideshow/SlideShowControl.ascx
@ Control Language="C#" AutoEventWireup="true" CodeFile="SlideShowControl.ascx.cs"
<%
Inherits="DotNetNuke.Modules.AJAXControlToolkit.AJAXControlToolkit" %>@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<
<
<
<
<
<
<
<
<
<
br />asp:Image ID="Image1" runat="server" Height="316px" Width="388px" ImageUrl="~/DesktopModules/SlideShow/images/Sunset.jpg" /><br />br />asp:Label ID="lblImageDescription" runat="server" /><br />br />asp:Button ID="Btn_Previous" runat="server" Text="Previous" />asp:Button ID="Btn_Next" runat="server" Text="Next" Width="64px" /><br />br />asp:Button ID="Btn_Play" runat="server" Text="Play" /><br />cc1:SlideShowExtender ID="SlideShowExtender1" AutoPlay="true" ImageDescriptionLabelID="lblImageDescription"
Loop="true" NextButtonID="Btn_Next" PlayButtonID="Btn_Play" PlayButtonText="Play"
PreviousButtonID="Btn_Previous" SlideShowServiceMethod="GetSlides" StopButtonText="Stop"
</
TargetControlID="Image1" runat="server" SlideShowServicePath="SlideShowService.asmx">cc1:SlideShowExtender>
file: AppCode/Slideshow/CarSlideServices/SlideShowService.cs
using
System;
using
System.Collections;
using
System.Web;
using
System.Web.Services;
using
System.Web.Services.Protocols;
///
///
<summary> Summary description for SlideShowService
///
</summary>
[
[
WebService(Namespace = "http://worldcarimports.com/")]WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]
public
class SlideShowService : System.Web.Services.WebService {public SlideShowService () {//Uncomment the following line if using designed components
//InitializeComponent();
}
[
}
[System.Web.Services.
[System.Web.Script.Services.ScriptMethod]
{
AjaxControlToolkit.
slides[0] =
slides[1] =
slides[2] =
slides[3] =
slides[4] =
}
}
WebMethod]public string HelloWorld() {return "Hello World";WebMethod]public AjaxControlToolkit.Slide[] GetSlides()Slide[] slides = new AjaxControlToolkit.Slide[5];new AjaxControlToolkit.Slide("~/DesktopModules/SlideShow/images/Blue hills.jpg", "Blue Hills", "Go Blue");new AjaxControlToolkit.Slide("~/DesktopModules/SlideShow/images/Sunset.jpg", "Sunset", "Setting sun");new AjaxControlToolkit.Slide("~/DesktopModules/SlideShow/images/Winter.jpg", "Winter", "Wintery...");new AjaxControlToolkit.Slide("~/DesktopModules/SlideShow/images/Water lilies.jpg", "Water lillies", "Lillies in the water");new AjaxControlToolkit.Slide("~/DesktopModules/SlideShow/images/VerticalPicture.jpg", "Sedona", "Portrait style picture");return (slides);
<%
<%