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
<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