Lightbox2 from photo directory - gallery

Is it possible to use the Lightbox2 script to display all photos from a given directory instead of listing each photo in the html?
This is really just a yes or no question, but please feel free to explain. I want to know if this is possible and if I should spend my time trying to figure it out. Thanks for the help.

No, Lightbox2 is written in JavaScript.
When used on a webpage, JavaScript is a client-side scripting language.
This means that the code executes on your web browser, and only has access to data the web browser makes available to it.
For more info: Client-side scripting
You need to use a server-side language (PHP, ASP.NET, etc.) to work with the server-side directories.
Here is an answer to a similar question, with a suggestion to create an index file w/ all the image file names that you could then parse with JavaScript. I don't think it would be much more efficient than manually adding img elements though.
Is there a way to return a list of all the image file names from a folder using only Javascript?

Related

What's the purpose of an asp:hyperlink, and how many strings is too many in a resource file?

I developed a (small) company website in Visual Studio, and I'm addicted to learning more. I really just have two simple questions that I can't google.
1 - Asp:hyperlinks:
What is the purpose of an asp.hyperlink? I know I can't use these in my resource files -- I have to convert 'em all back to html links. At first, asp:hyperlinks looked sophisticated, so I made all my links asp:hyperlinks. Now I'm reverting back. What's the purpose of an asp:hyperlink, if any?
2 - Resource Files and strings:
In localizing my website, I have found that I'm putting the .master resource files in the directory's App_LocalResources folder VS created, because you can't change the top line stuff in a .master file and put a culture/uiculture in there. But all of my regular .aspx pages are going into the root App_GlobalResources folder into 1 of 4 language resource files (de, es-mx, fr, en). I'm making 2 or 3 strings per .aspx page. So when you have 47 pages in your website, that's about 100 strings on a resource page.
I just learned about all of the resources stuff from this forum and MSDN tutorials, so I have to ask, 'cause it's a lot of work. Is this okay? Is it normal? Am I going about this the wrong way?
I've never used resources, so can't comment on that.
Differences between asp:hyperlink and a tag that I know of:
asp:hyperlink is converted to an A tag by the ASP.NET engine when output to the browser.
It is possible asp:hyperlink could make browser specific adjustments, to overcome browser bugs/etc.. which is kind of the point of ASP.NET, or at least one of them. If not already in it, they could be added later, and by using those objects you'll get that when/if added.
Both can be used in code behind (you can set runat="server" for an A tag), but the asp:hyperlink has better compile-time checking in most cases -- strong type-casting for more items vs generic objects.
asp:hyperlinks are easier to get HTML bloat, but only if used with a poor design. For example, it is easy to set font styles and colors on them.. but I wouldn't, since that generates in-line styles that are usually pretty bloated compared to what you would do by hand or in a CSS file.
asp:hyperlinks support the "~/Folder/File.ext" syntax for the TargetUrl (href), which is nice in some projects if you use a lot of different URLs and sub-folders and want the server to handle mapping in a "smart" way.
The purpose of is to display a link to another webpage.
With the resource files, since you're not a programmer and just developing a small program, use something you're comfortable with. Resource files are easy to use for beginners when you want to localize your web content -- and yes, it's normal to be adding many strings if you need them.
For #1
Using a hyperlink control over just a piece of text will allow you to access the control at runtime and manipulate its contents if you want to change the link dynamically, if you have static links that will never change then its simpler to just use plain text ie. <a href=''>

Ajax File uploader

I just wanted to ask a question about uploading files via AJAX. I have researched on the web and found many articles on doing this. I am using ASP.NET 2.0.
I am probably going to go the jQuery route on this one, but I'm still unsure, I just need some feedback. Bacause my aim is to create an admin page for my client to add new products to his site when my client wishes to, so my client wants a simple file uploader and a multiple file uploader.
The first question is which is the best AJAX File Uploader to use?
The second question is how many files can you upload via AjAX, are there limits to how much you upload with different techniques ie. using jQuery or SWFUpload or using IHTTPHandler?
I would be grateful for your feedback.
Thanks.
I actually had to do this for an item here at work. To keep things rather simple, I went old-school and used a hidden iframe to do the file transfer in the background. There may be more fancy ways, but this worked for me. Also, there's no headaches when Adobe pushes out a bad update.
It was a while ago, so I can't remember the nuts n' bolts of the top of my head, but here's an article that seems to be using the same idea:
http://www.openjs.com/articles/ajax/ajax_file_upload/
This is a subjective question, as there is no one solution fits all for your application. The right answer is the uploader that meets your business needs. Limitations, if they exist, are set per whatever component you decide to use.

Multiple-target cross-browser drag& drop file upload

We're investigating if it's possible to have the following: A webpage with multiple 'folders' to which a user can drag & drop a files. It's meant to be used as an interface to upload scanned documents to an archive.
For example, we would have page that states: 'Quotes', 'Invoices' & 'Misc'. Depending on the sort of document the user would drag & drop the file from the local file system to one of these three folders. It should then upload the file to the correct folder on the web server.
Is this possible, and if it is, any existing solutions using ASP.NET?
You can use modern browsers HTML5 functionalities to do so. A detailed explanation here:
http://www.useragentman.com/blog/2010/01/10/cross-browser-html5-drag-and-drop/
There is also the jQuery plugin: https://github.com/weixiyen/jquery-filedrop This one is a bit bogus (truncates files with accents like in french, doesn't handle correctly several drop areas in the same page, ...), but are easy to fix (I sent a fixed version to the author weeks ago, but didn't get any feedback...)
With some Ajax and the correct server-side solution, it works like a charm. I don't know any .NET solution, though.
Best,
You could use a silverlight app or a java applet, but those are the only solutions that I know of... The users would obviously need to have silverlight or the jre installed.

Upload an entire folder's files with jquery.MultiFile.js instead of having to select each file individually

I have jquery multi-file working as shown in link text. However, what I really need is to be able to select a folder, then every file contained in the selected folder to be listed, at which the user could then remove any unwanted files before hitting 'upload.'
Has anyone done this with jquery multi-file upload? Would it be difficult to modify multi-file.js to make it do this? Are there any other open-source possibilities? I would love to use the ASP.NET FileUpload control without any javascript but it seems rather limited [I have virtually no javascript knowledge...yet].
Any insights, tips or suggestions would be greatly appreciated!
This widget still uses HTML's <input type=file> capabilities that is extremely simple and non-customizable. That's why you won't be able to change existing script to be able of selecting multiple files inside Open File dialog.
For selecting multiple files at once you're going to have to use Flash. The good news is, they normally come with upload progress bar as well.
Try Uploadify plugin script instead.

Multiple file uploader - looking at Google Docs implementation

I'm looking to implement a multiple file uploader in my ASP.NET 3.5 site.
Now, the Google Docs multi-file uploader is pretty awesome, and I'd like to create something like that. Correct me if I'm wrong, but Google Docs is not open source, so I can't get my hands on the source code for it.
Any ideas on how this is implemented, or the best way of creating a nice interactive multi-file uploader like it?
I strongly suggest you give this jquery file upload plugin a try: "uploadify". It makes it super easy to integrate such a feature.
Nice and interactive : you can build a Silverlight client to send your files to webserver. It allows to select multiple files at once.
I guess 'Zhaph - Ben Duguid' had the best answer for this one. Post it as an answer and I'll accept it!
GoogleDocs uses a combination of Flash and JS, with the bulk of the work happening in the Flash object, rather than the JS, and they heavily minify their JS to make it smaller to download, and also harder to read...

Resources