Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 22nd, 2011, 05:01 PM
Authorized User
Points: 224, Level: 4
Points: 224, Level: 4 Points: 224, Level: 4 Points: 224, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2011
Posts: 41
Thanks: 3
Thanked 4 Times in 3 Posts
Default Chp 14, PhotoAlbum extension

Hi Imar,

I took some initiative and tried to make a slideshow page for a picture album. Conceptually, I created an array, loaded all the images (file locations) for an album into the array, and then saved the array in ViewState. Then on a 4 sec timer, I get the next image in the ViewState array (using another viewstate to keep index count).

QUESTION: Is this an "Ok" approach? I understand that if I had a ton of images (lots of data), then I risk ViewState getting bloated. But then, I thought I could always limit the array load to keep ViewState manageable, and then just create another array to load another set of pictures when the user gets to that point, etc. On a conceptual level, is there a better approach? If so could you mention, in general terms, the better approach? Or is this method "ok"? TIA.
 
Old October 29th, 2011, 11:46 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

For small sets of images this would work fine. But, as you indicated, you'll run into issues when the number of images increases. Personally, I would store just the image index and recreate the array at each postback. This way, your code automatically scales in case the number of increases.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!




Similar Threads
Thread Thread Starter Forum Replies Last Post
Imar: Chp 14 - ManagePhotoAlbum.aspx nanonerd BOOK: Beginning ASP.NET 4 : in C# and VB 1 October 13th, 2011 12:38 PM
Imar: Bug chp 14, please remedy nanonerd BOOK: Beginning ASP.NET 4 : in C# and VB 1 October 5th, 2011 01:30 PM
CHP 14, Now PC and New SqlExpress ssndude BOOK: Beginning ASP.NET 4 : in C# and VB 1 May 7th, 2011 03:11 AM
chp 14: ulysses installation problems DMatt BOOK: Professional PHP6 0 December 9th, 2010 06:28 PM
Chp 14 e-commerce JamesA BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 3 September 3rd, 2004 06:14 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.