// Information about the file selected to be sent back when clicked
imageButton.Click += new ImageClickEventHandler(ThumbnailClick);
// Click wasn't working so I added the following
.... retrieve fileID, query dataBase for url and set up the full version of the image on the page
Because the ImageButtons are not in the markup and don't get added when the Page constructor runs I have to bring them back out of session. Since it's all a bit new to me, I'm not 100% sure I'm doing this at the right point in the page lifecycle.
foreach (string s in (List<string>)Session[THUMBNAIL_KEYS])
if (Session[s] != null)
ImageButton i = (ImageButton)Session[s];
This loads them back into the page nicely but the event doesn't fire.
I initially only set the Click property on the ImageButtons, then I thought about the fact that the ImageButtons get placed into session before they are rendered, so when pulling them out of Session again it's as if they had never been clicked.
So I then added the OnClientClick string, I can get the Request.Form["__EVENTTARGET"] and Request.Form["__EVENTARGUMENT"] information back nicely at page load and display it on a couple of labels.
I've started to look at Page methods such as RaisePostBackEvent() and RegisterRequiresRaiseEvent()