Asp.net ajax slideshow
Har et slideshow hvor jeg vil have billeder fra en mappe på c drev... Når jeg kører slideshow fra en mappe i min solution virker det perfekt, men når den skal finde dem fra en mappe på c drevet går den i koma... Har kørt debugger og den finder de billeder som er i min mappe, men når den skal tilføje dem i et array senere stopper den med en fejl.There is no source code available for the current location
Koden ser således ud...
<script runat="Server" type="text/C#">
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static AjaxControlToolkit.Slide[] GetSlides()
{
//string[] annoncer = System.IO.Directory.GetFiles(@"c:\annoncer\", "*.jpg");
//int antal = annoncer.Length;
//AjaxControlToolkit.Slide[] slides = new AjaxControlToolkit.Slide[antal];
//for (int j = 0; j <annoncer.Length ; j++)
//{
// slides[j] = new AjaxControlToolkit.Slide(annoncer[j+1].ToString(),"","");
//}
//AjaxControlToolkit.Slide[] slides = new AjaxControlToolkit.Slide[6];
//slides[0] = new AjaxControlToolkit.Slide("images/Blue hills.jpg", "Blue Hills", "Go Blue");
//slides[1] = new AjaxControlToolkit.Slide("images/Sunset.jpg", "Sunset", "Setting sun");
//slides[2] = new AjaxControlToolkit.Slide("images/Winter.jpg", "Winter", "Wintery...");
//slides[3] = new AjaxControlToolkit.Slide("images/pic1.gif", "Sedona", "Portrait style picture");
//slides[4] = new AjaxControlToolkit.Slide("images/pic2.png", "Sedona", "Portrait style picture");
//slides[5] = new AjaxControlToolkit.Slide("images/pic3.jpeg", "Sedona", "Portrait style picture");
string[] fileNames = System.IO.Directory.GetFiles(@"c:\annoncer\", "*.jpg");
AjaxControlToolkit.Slide[] slides = new AjaxControlToolkit.Slide[fileNames.Length];
for (int i = 0; i < fileNames.Length; i++)
{
string[] file = fileNames[i].Split('\\');
slides[i] = new AjaxControlToolkit.Slide("annoncer/" + file[file.Length - 1], "", "");
}
return(slides);
}
</script>
<br />
<br />
<asp:Image ID="Image1" runat="server" Height="316px" Width="388px" ImageUrl="C:\\annoncer\\pic1.jpg"/><br />
<br />
<cc1:SlideShowExtender ID="SlideExtender"
AutoPlay="true"
Loop="true"
SlideShowServiceMethod="GetSlides"
TargetControlID="Image1"
runat="server" PlayInterval="2000">
</cc1:SlideShowExtender>
<cc1:AnimationExtender id="MyExtender" runat="server" BehaviorID="ae"
TargetControlID="Image1">
<Animations>
<OnLoad>
<Sequence>
<FadeOut Duration="0" Fps="20" />
<FadeIn Duration="0" Fps="20" />
</Sequence>
</OnLoad>
</Animations>
</cc1:AnimationExtender>
</div>