Wrox Programmer Forums
|
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion 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 August 23rd, 2012, 05:50 AM
Registered User
 
Join Date: May 2012
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
Question multiview, prevent page reload

Hi all,

I made a sort of photoalbum. I have a page that contains 3 views inside a multiview. I have some code that scans a directory and loads the images and thumbnails in an array. Then some code is executed to decide which images need to be shown on each view.

Also the views have a previous and next button. The buttons have a commandname nextview and prevview.

My code is called when the page is loaded. Now the problem I'm having is that when I click the next or previous button the page is loaded again and the code is executed again which means the images are written to the views again.

Now I've solved this by adding some code to clear the views when the page reloads but I'm wondering if there's a cleaner approach? I'd like to prevent the execution when it's not necessary.

I've tried putting the views in a updatepanel but that didn't help either.

Thanks,
 
Old August 24th, 2012, 10:31 AM
Registered User
 
Join Date: May 2012
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Solved by using:
Code:
If Not IsPostBack Then
code to execute
        End If





Similar Threads
Thread Thread Starter Forum Replies Last Post
reload parent page from included page sbkumar Javascript 2 July 24th, 2008 03:56 PM
Reload page Tooltip not work - Reload xslt file? ismailc XSLT 10 January 22nd, 2008 10:03 AM
Reload page only once. rupen Javascript How-To 4 September 13th, 2007 06:34 AM
I want page to not reload omersharp ASP.NET 2.0 Professional 0 December 13th, 2006 07:06 PM
Reload a page mivan2001 Javascript How-To 1 July 23rd, 2003 03:25 AM





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