>> I am porting my digital photo archive from a windows app to web using
>> ASP.NET 2.0
[quoted text clipped - 20 lines]
> conditional (and it's conditional on a postback from the search button, so
> chuck the ID of the search button in the trigger that you setup for this).
The thumbnail update panel is set to conditional, but the case is that on
clicking on an imagebutton inside the updatepanel, the updatepanel is posted
back - witch it actually has to do if I want some servercode to be executed.
So, in my mind this solution works as it technically is supposed to, only
not as I want it to.
I have found a workaround that at least mimics my desire: The images are
presented as html images instead of asp:imagebuttons, then I attach an
"onclick" triggered client script: So what does this client script do?
It writes the image ID into a hidden field, and then emulate a click event
on a descrete button. Both the hidden field and the discrete button resides
in a separate update panel, so the script actually post back this small
update panel, which in server code retrieves the larger image and updates
the update panel with the large image.
This works very well, and I have even added an Ajax animation control that
fades in the image on load so it looks kind of nice. I should only try to
hide the discrete button...
Still I am not sure this is the optimal way, but for now it will do. There
is no unneccessary screen updates, and soon the web-solution doesn't stand
much back for the windows one.
> Another thing you might consider is paging the results of a seach (showing
> them 10 or 20 at a time) which should help with the delay problem.
The problem is not any problem anymore when the image list isn't updated on
each image_click. But of course, if the result should be like 1000
images...? So paging is absolutely something I should add.
Bjorn
James Crosswell - 04 Dec 2007 14:43 GMT
> The thumbnail update panel is set to conditional, but the case is that on
> clicking on an imagebutton inside the updatepanel, the updatepanel is posted
> back - witch it actually has to do if I want some servercode to be executed.
> So, in my mind this solution works as it technically is supposed to, only
> not as I want it to.
Ah, I see. Sorry, my bad - I didn't read your original post very well.
An alternative to a postback would be to use a callback (javascript that
makes an asynchronous call to the server). I'm not sure what this is
called in the MS AJAX toolkit - I know DevExpress have a callback
component though for exactly the situation that you're describing.
Best Regards,
James Crosswell
Microforge.net LLC
http://www.microforge.net
Bjorn Sagbakken - 04 Dec 2007 17:12 GMT
>> The thumbnail update panel is set to conditional, but the case is that on
>> clicking on an imagebutton inside the updatepanel, the updatepanel is
[quoted text clipped - 8 lines]
> called in the MS AJAX toolkit - I know DevExpress have a callback
> component though for exactly the situation that you're describing.
Yes, that was one of my trial ... and errors. I think I was very close to
success, so I will have another go for that later.
ASP.NET 2.0 have a Client Callback method called "ICallbackEventHandler"
that will do this.
Bjorn