G
gabriel
greetings,
I am currently stucked with the following problem :
I got userControl which is programmatically fed ImageButtons. Then, in
his render method, it creates a table containing the imagebuttons.
When I Click on the imageButton, the browser should be redirected to
some url.
The thing is a gallery, as you might have guessed.
here is the method used to feed the control :
public void addImageButton(ImageButton image)
{
if (this.imageButtonList == null)
this.imageButtonList = new ArrayList();
this.imageButtonList.Add(image);
image.CommandArgument = "1";
image.CommandName = "gotoanyway";
image.Command += new
System.Web.UI.WebControls.CommandEventHandler(this.processImageCommand);
image.Click += new System.Web.UI.ImageClickEventHandler
(this.processImageClick);
}
I played with CommandEventHandler and ImageClickEventHandler but got no
result. In fact, the event is not even captured.
What I think is that the event is sent to the page but since she has no
ImageClickEventHandler, the event is just lost.
Is it possible to delegate the processing of the event from the page to
the imageButton ?
I do not know much yet about the delegate pattern, thus my question
many thanks for your input !
I am currently stucked with the following problem :
I got userControl which is programmatically fed ImageButtons. Then, in
his render method, it creates a table containing the imagebuttons.
When I Click on the imageButton, the browser should be redirected to
some url.
The thing is a gallery, as you might have guessed.
here is the method used to feed the control :
public void addImageButton(ImageButton image)
{
if (this.imageButtonList == null)
this.imageButtonList = new ArrayList();
this.imageButtonList.Add(image);
image.CommandArgument = "1";
image.CommandName = "gotoanyway";
image.Command += new
System.Web.UI.WebControls.CommandEventHandler(this.processImageCommand);
image.Click += new System.Web.UI.ImageClickEventHandler
(this.processImageClick);
}
I played with CommandEventHandler and ImageClickEventHandler but got no
result. In fact, the event is not even captured.
What I think is that the event is sent to the page but since she has no
ImageClickEventHandler, the event is just lost.
Is it possible to delegate the processing of the event from the page to
the imageButton ?
I do not know much yet about the delegate pattern, thus my question
many thanks for your input !