![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Professional Programmer
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 372
Rep Power: 0
![]() |
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.
__________________
I am Addicted to Linux! |
|
|
|
|
|
#2 |
|
Man Bear Pig Hunter
Join Date: Jul 2005
Location: NorCal, USA
Posts: 292
Rep Power: 4
![]() |
Re: Slide Show
Please post java-script
__________________
People who click "images" that end with .exe shouldn't have computers. |
|
|
|
|
|
#3 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
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:
php Syntax (Toggle Plain Text)
|
|
|
|
|
|
#4 |
|
Man Bear Pig Hunter
Join Date: Jul 2005
Location: NorCal, USA
Posts: 292
Rep Power: 4
![]() |
Re: Slide Show
Here are a few places to check out.
http://www.asp.net/AJAX/AjaxControlT...SlideShow.aspx http://aspnet.4guysfromrolla.com/articles/070704-1.aspx http://www.codeproject.com/KB/ajax/ASPNETSlideShow.aspx
__________________
People who click "images" that end with .exe shouldn't have computers. |
|
|
|
|
|
#5 |
|
King of Portal
|
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
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
|
|
#6 |
|
King of Portal
|
Re: Slide Show
Alright I tested the following code on my local Apache server:
<script type="text/javascript">
function httpGetText(aURL) {
var req = new XMLHttpRequest();
req.open('GET', aURL, false);
req.send(null);
return req.responseText;
}
document.write(httpGetText('http://localhost/somedir/'));
</script>
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
|
|
#7 |
|
Professional Programmer
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 372
Rep Power: 0
![]() |
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/";
DirectoryInfo di = new DirectoryInfo(directory);
foreach (FileInfo oFile in di.GetFiles())
{
string fileName = oFile.Namel
// ...
}
__________________
I am Addicted to Linux! |
|
|
|
|
|
#8 | |
|
Professional Programmer
Join Date: May 2006
Location: UK - London
Posts: 329
Rep Power: 3
![]() |
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()
__________________
Quote:
|
|
|
|
|
|
|
#9 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 754
Rep Power: 3
![]() |
Re: Slide Show
You can probably use
Server.MapPath("~/Some/Path") ![]()
__________________
<insert disclaimer here> <insert shameless plug for Visual Studio here> |
|
|
|
|
|
#10 |
|
Professional Programmer
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 372
Rep Power: 0
![]() |
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.
__________________
I am Addicted to Linux! |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| TV Show - The IT Crowd | milot | Coder's Corner Lounge | 8 | Jan 8th, 2007 10:44 PM |
| Size of Button before show() | susam_pal | Java | 1 | Sep 22nd, 2005 10:24 AM |
| Anyone watch the Drew Carey show? | Sane | Coder's Corner Lounge | 12 | Jul 10th, 2005 12:36 AM |
| Want to upload, show as HTML and other things.... | Invisible | Other Web Development Languages | 4 | Jun 19th, 2005 7:51 PM |
| how to get a little icon to show up next to your url. | linuxpimp20 | HTML / XHTML / CSS | 1 | Jun 12th, 2005 9:29 PM |