multiview, prevent page reload
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.