![]() |
Slide Show
I am doing a website in ASP.Net and I need to implement a slide show and I have a few questions.
I was able to implement one in JavaScript fairly easily, but I need to be able to load all the images from a folder without knowing how many images there will be and I do not think that is possible with JavaScript. If there is a way to be able to read/display all the images from a folder (without knowing all the files names) with JavaScript please let me know ;). If the JavaScript way is not possible I will do it server-side. If I do it server-side is there a way to have it automatically switch the picture after X amount of time without an AJAX timer or anything fancy like that? I may just end up using the AJAX slide show control. It is a fairly simple website and did not want to use too much server-side code or AJAX stuff. Thanks for any input on this. |
Re: Slide Show
Please post java-script
|
Re: Slide Show
I would use ASP.NET to tell the JavaScript what the file names are. Not sure about ASP, but this is how I'd do it in PHP:
:
|
Re: Slide Show
|
Re: Slide Show
Don't know if this will be of use to you, as I just happened over it and didn't really inspect it too closely:
http://www.wikicodia.com/wiki/JavaSc...ory_files_list http://www.codeproject.com/KB/script..._in_files.aspx |
Re: Slide Show
Alright I tested the following code on my local Apache server:
:
<script type="text/javascript"> |
Re: Slide Show
Thanks for the info guys. I have chosen to use the Ajax Slide Show control.
I have one more question. In ASP, what is the best way to get a list of files from a directory? This is how I am doing it currently: :
string directory = "c:/Inetpub/wwwroot/MyWebsite/test_images/"; |
Re: Slide Show
Try getting the current working directory and go from there, not sure of exact syntax but I think it goes something like this:
:
Directory.GetCurrentDirectory() |
Re: Slide Show
You can probably use
Server.MapPath("~/Some/Path") :) |
Re: Slide Show
kruptof / Jimbo... both of those worked :)
Server.MapPath("~/Some/Path") did it in one less step though. Thanks guys. I now have the slide show running as desired. |
| All times are GMT -5. The time now is 8:22 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC