I'm having a bit of trouble with an old delphi.net application.
I need to show some thumbnail images on a specific location on the page, and when the user clicks the image show the image.
The images are rather small so I havn't bothered with thumbnail generation.
The problem is that I can't get the onclick event working.
Here is my code: (This is in the page_load event)
filer := Directory.GetFiles(dirstr,soegestr);
for f in filer do
begin
img := ImageButton.Create;
img.ImageUrl := f;
img.Width := 30;
img.Height := 50;
img.Style.Add('margin-right','10px');
include(img.Click, FragtbrevsBilledeClick);
PanelBilleder.Controls.Add(img);
end;
include does nothing. The onclick event just triggers a postback.
FragtbrevsClick is defined as follows:
procedure TWebForm1.FragtbrevsBilledeClick(Sender: TObject;
e: ImageClickEventArgs);
begin
Response.Redirect((sender as ImageButton).ImageUrl);
end;
Setting a breakpoint in fragtbrevs clicks never gets hit.
I'm not a reguler web developer so alternative ways to solve the problem is also welcome! :-)