Slide show extender not working.

Posted by Shreedar under ASP.NET AJAX on 9/27/2015 | Points: 10 | Views : 587 | Status : [Member] | Replies : 3
Below is my webservice code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using AjaxControlToolkit;

[WebService]
[System.Web.Script.Services.ScriptService]
public class SlideService : System.Web.Services.WebService
{
[WebMethod()]
public Slide[] getslide()
{
Slide[] s=new Slide[5];
s[0] = new Slide("1.jpg", "desert", "display desert");
s[1] = new Slide("2.jpg", "cat", "display");
s[2] = new Slide("3.jpg", "dog", "display");
s[3] = new Slide("4.jpg", "tiger", "display");
s[4] = new Slide("5.jpg", "lion", "display");
return (s);
}
}


I made settings for slideshowextender also.

Regards

Sridhar Thota.
www.dotnet-sridhar.blogspot.com



Responses

Posted by: Rajnilari2015 on: 9/27/2015 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 25

Up
0
Down
I modified a bit of your program to make it work

SlideService.aspx.cs
------------------------

using System;

using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using AjaxControlToolkit;
using System.Web.Services;
using System.Web.Script.Services;
using System.Collections.Generic;

public partial class SlideService : System.Web.UI.Page
{
[WebMethod]
[ScriptMethod]
public Slide[] getslide()
{
List<Slide> slides = new List<Slide>();
slides.Add(new Slide{Name = "desert",Description = "display desert",ImagePath = "1.jpg"});
slides.Add(new Slide{Name = "cat",Description = "display",ImagePath = "2.jpg"});
slides.Add(new Slide{Name = "dog",Description = "display",ImagePath = "3.jpg"});
slides.Add(new Slide{Name = "tiger",Description = "display",ImagePath = "4.jpg"});
slides.Add(new Slide{Name = "lion",Description = "display",ImagePath = "5.jpg"});
return slides.ToArray();
}
}


SlideService.aspx
-------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SlideService.aspx.cs" Inherits="SlideService" %>


<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
body
{
font-family: Arial;
font-size: 10pt;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</cc1:ToolkitScriptManager>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:Button ID="btnPrevious" runat="server" Text="<<" Font-Size="20" />
</td>
<td>
<asp:Image ID="Image1" runat="server" Height="300" Width="300" />
<cc1:SlideShowExtender ID="SlideShowExtender" runat="server" TargetControlID="Image1"
SlideShowServiceMethod="GetImages" ImageTitleLabelID="lblImageTitle" ImageDescriptionLabelID="lblImageDescription"
AutoPlay="true" Loop="true" PlayButtonID="btnPlay" StopButtonText="Stop"
PlayButtonText="Play" NextButtonID="btnNext" PreviousButtonID="btnPrevious">
</cc1:SlideShowExtender>
</td>
<td>
<asp:Button ID="btnNext" runat="server" Text=">>" Font-Size="20" />
</td>
</tr>
<tr>
<td colspan="3" align="center">
<asp:Button ID="btnPlay" runat="server" Text="Play" Font-Size="20" />
</td>
</tr>
<tr>
<td colspan="3" align="center">
<br />
<b>Name:</b>
<asp:Label ID="lblImageTitle" runat="server" Text="Label" /><br />
<b>Description:</b>
<asp:Label ID="lblImageDescription" runat="server" Text="Label" />
</td>
</tr>
</table>
</form>
</body>
</html>


Hope this helps
 Download source file

--
Thanks & Regards,
RNA Team

Shreedar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shreedar on: 9/27/2015 [Member] Starter | Points: 25

Up
0
Down
Thanks for your reply.

Its not giving any error message.
Images are not displayed, just got the design part.
First I added a webservice for getting slides and a default.aspx page for design.
In design for image control I added slideshow extender and made necessary settings. still not working.

Regards

Sridhar Thota.
www.dotnet-sridhar.blogspot.com

Shreedar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajnilari2015 on: 9/27/2015 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 25

Up
0
Down
@Sridhar Thota, I believe that the Image path is not being set properly and that's the cause.However, I have uploaded the experimental file.Please try that.
 Download source file

--
Thanks & Regards,
RNA Team

Shreedar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response