User control

kaisersoze

Centurion
Joined
Aug 27, 2003
Messages
152
I have a user control and it has 3 imagebuttons: Clear, save and delete. I loaded dynamically the usercontrol into a default.aspx page. during runtime everything is loading fine . But, when I click on save button on the user control the controlflow is not going to the click event of the button in the user control. and page is reloaded. what is the i am missing
 
Try something like this in your user control - I had this same issue and this worked for me:

protected override bool OnBubbleEvent(object source, System.EventArgs args)
{
ImageButton myBtn = new ImageButton(); //TYPE COMPARISON OBJECT

if( source.GetType().Equals(myBtn.GetType()))
{
ImageButton oButton;
oButton = (ImageButton)source;

switch (oButton.ID)
{
case "btnSave":
{
//DO SOMETHING AFTER A "SAVE" CLICK DETECTED
break;
}
.....
}
return true;
}
 
Back
Top