1.Created interface:
public interface ITriggerable {
void RegisterPostbackTrigger(Control parent,Control trigger);
}
2.implement this interface on page containing ajax update panel:
public void RegisterPostbackTrigger(Control parent,Control button){
PostBackTrigger trigger = new PostBackTrigger();
trigger.ControlID =((Button) button).UniqueID;
UpdatePanel1.Triggers.Add(trigger);
}
3.Add button inside of control as trigger:
protected override void OnInit(EventArgs e){
base.OnInit(e);
((ITriggerable)this.Page).RegisterPostbackTrigger(this, btnRename);
}
No comments:
Post a Comment