Click here to Skip to main content
15,884,177 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi,
i want to get my slideshowextender same pic in my folder and i found in net using web services this's my code and it dosen't work plzz i need help very quickly

web service code

[WebMethod]
public AjaxControlToolkit.Slide[] GetImages()
{
List<slide> slides = new List<slide>();

string path = HttpContext.Current.Server.MapPath("~/images/");
if (path.EndsWith("\\"))
{
path = path.Remove(path.Length - 1);
}
Uri pathUri = new Uri(path, UriKind.Absolute);
string[] files = Directory.GetFiles(path);
foreach (string file in files)
{
Uri filePathUri = new Uri(file, UriKind.Absolute);
slides.Add(new Slide
{
ImagePath = pathUri.MakeRelativeUri(filePathUri).ToString()
});
}
return slides.ToArray();
}

page aspx code

XML
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnablePageMethods="true"></asp:ToolkitScriptManager>
        Normal<hr />

        <asp:Image ID="Image2" runat="server" Height="300" Style="border: 1px solid black;
    width: auto;" />
<br />
<br />
<asp:Button runat="Server" ID="prevButton" Text="Prev" Font-Size="Larger" />
<asp:Button runat="Server" ID="playButton" Text="Play" Font-Size="Larger" />
<asp:Button runat="Server" ID="nextButton" Text="Next" Font-Size="Larger" />
<asp:SlideShowExtender ID="slideshowextend1" runat="server" TargetControlID="Image2"
    SlideShowServiceMethod="GetImages" AutoPlay="true" NextButtonID="nextButton"
    PlayButtonText="Play" StopButtonText="Stop" PreviousButtonID="prevButton" PlayButtonID="playButton"
    Loop="true" SlideShowServicePath="~/SlideShowService.asmx"/>




plzz i neeeed help very very quickly and thanks
Posted

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