Apr 06, 2010, 10:39 AM
[1.0] XRender - Creating controls during DirectEvent
Hi,
Thank you for the hard work you did on v1.0. Looks great :)
I'm trying to create a control during DirectEvent and I want to postback using the created control.
My code:
Thanks, Omer.
Thank you for the hard work you did on v1.0. Looks great :)
I'm trying to create a control during DirectEvent and I want to postback using the created control.
My code:
protected void Page_Load(object sender, EventArgs e)
{
var b = new Ext.Net.Button("Click Me");
b.DirectEvents.Click.Event += new ComponentDirectEvent.DirectEventHandler(c_Event);
this.Controls.Add(b);
b.Render();
}
void c_Event(object sender, DirectEventArgs e)
{
}
but it fails:HttpException (0x80004005): The control with ID 'id0ac2c6e68e284660b7766ed399a76908' not found] Ext.Net.ResourceManager.RaisePostBackEvent(String eventArgument) +1083 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Am I missing something fundamental? Can this be done at all?Thanks, Omer.