Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 22nd, 2011, 06: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.
Reply With Quote
  #2 (permalink)  
Old October 29th, 2011, 12:46 PM
Imar's Avatar
Wrox Author
Points: 71,164, Level: 100
Points: 71,164, Level: 100 Points: 71,164, Level: 100 Points: 71,164, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,960
Thanks: 79
Thanked 1,559 Times in 1,536 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!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 01:38 PM
Imar: Bug chp 14, please remedy nanonerd BOOK: Beginning ASP.NET 4 : in C# and VB 1 October 5th, 2011 02:30 PM
CHP 14, Now PC and New SqlExpress ssndude BOOK: Beginning ASP.NET 4 : in C# and VB 1 May 7th, 2011 04: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 07:14 PM



All times are GMT -4. The time now is 11:21 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.