Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Web Service file

[System.Web.Script.Services.ScriptService]
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static AjaxControlToolkit.Slide[] GetSlides()
{
AjaxControlToolkit.Slide[] slides=new AjaxControlToolkit.Slide[3];
slides[0]=new AjaxControlToolkit.Slide("12.jpg", "Image1", "a");
slides[1]=new AjaxControlToolkit.Slide("37.jpg", "Image1", "a");
slides[2]=new AjaxControlToolkit.Slide("38l.jpg", "Image1", "a");
return (slides);
}

C# code

<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">

<asp:Image ID="Image1" runat="server" />

<asp:Button ID="Button1" Text="<<<" runat="server" />
<asp:Button ID="Button2" Text="<<<" runat="server" />
<asp:Button ID="Button3" Text="<<<" runat="server" />

<ajaxToolkit:SlideShowExtender ID="SlideShowExtender1" runat="server"
TargetControlID="Image1"
SlideShowServiceMethod="GetSlides"
SlideShowServicePath="~/Service.asmx"
PreviousButtonID="Button1"
PlayButtonID="Button2"
NextButtonID="Button3"
PlayButtonText="Play"
StopButtonText="Stop"
AutoPlay="true">
Posted
Comments
[no name] 28-May-13 15:16pm    
Your "C# code" is not C# code at all.
Where are you getting this error?
Sergey Alexandrovich Kryukov 28-May-13 21:39pm    
Exactly.
—SA
Angie Nicol 1-Jun-13 2:31am    
This is I've written in ASP.Net

1 solution

I assume you are getting the error on the line:
C#
public static AjaxControlToolkit.Slide[] GetSlides()

If so, then check that you have the right using statement for the AjaxControlToolkit, or that the right assembly reference is included.
 
Share this answer
 
Comments
Angie Nicol 29-May-13 7:54am    
I have tried for using System.Web.Extensions also, but error is still there. What is wrong with the code?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900