Oct 21, 2011, 8:12 PM
[CLOSED] DirectEvent in WebControl
I have a webcontrol that is created a Ext.Net.Button dynamically in overridden CreateChildControls() of the WebControl. The WebControl is within a page that is using a Masterpage. The Masterpage ID is "Body".
The button code is as followed:
SpecialButtons Control:
The button code is as followed:
SpecialButtons Control:
Ext.Net.CompositeField buttons = new Ext.Net.CompositeField() { Width = new Unit(600, UnitType.Pixel) };
Ext.Net.Button delete = new Ext.Net.Button() { ID = "DeleteButton", Text = "Delete", Icon = Icon.Delete };
delete.DirectEvents.Click.Event += this.DeleteClick;
buttons.Items.Add(delete);
Controls.Add(buttons);
The DeleteClick is:public void DeleteClick(object sender, DirectEventArgs e) {
string test = null;
}
The page calls the control via:<custom:SpecialButtons ID="Buttons" runat="server" />
However, it renders the controls fine. However, whenever I click the button, it throws an error of:The control with ID 'Body_DeleteButton' not found
Can anyone point me in the right direction?
Last edited by Daniil; Oct 22, 2011 at 6:59 AM.
Reason: [CLOSED]