Want to display images in slider in but function is not executing
<asp:Image ID="img_slider" runat="server" Height="250" Width="410" alt="" /><asp:SlideShowExtender ID="SlideShowExtender" runat="server" TargetControlID="img_slider"
SlideShowServiceMethod="GetImages" AutoPlay="true" PlayInterval="1000" Loop="true"></asp:SlideShowExtender> [WebMethod]
[ScriptMethod]
public Slide[] GetImages()
{
List<Slide> slides = new List<Slide>();
string path = HttpContext.Current.Server.MapPath(TopRootName + _File_Format + RootName + HashKey);
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();
}when i write static keyword with function then it's not accepting my parameter that i am passing i MapPath()? Waiting for your response!