PDA

View Full Version : [CLOSED] XRender: UpdateContent error



jamesand
Jan 08, 2014, 8:40 AM

Daniil
Jan 08, 2014, 12:58 PM
Hi @jamesand,

I guess you are using a Click DirectEvent for those Buttons. Probably, you don't recreate the user control during each request.

The example that you mentioned:
http://examples2.ext.net/#/XRender/UserControl/UpdateContent/

This is the essential part to get working the DirectEvents inside the user controls.

protected void Page_Load(object sender, EventArgs e)
{
if (!string.IsNullOrWhiteSpace(CurrentControl.Text))
{
this.LoadUserControl(CurrentControl.Text);
}
}

jamesand
Jan 08, 2014, 4:55 PM
Probably, you don't recreate the user control during each request.
[/CODE]

That's right Daniil, I didn't.

Works as expected. Thanks.

michaeld
Jan 09, 2014, 4:25 AM
Hope I'm not barging in but this is exactly why I started working on http://forums.ext.net/showthread.php?27618-Add-UserControls-in-DirectEvents-Methods-and-have-them-automatically-Reload-on-Post-back-through-messaging-in-Hidden-Fields

If you're planning to reuse ajaxable UserControls a lot or your website is public, you might want to consider the control security model at least.

jamesand
Jan 09, 2014, 9:09 AM
Hope I'm not barging in but this is exactly why I started working on http://forums.ext.net/showthread.php?27618-Add-UserControls-in-DirectEvents-Methods-and-have-them-automatically-Reload-on-Post-back-through-messaging-in-Hidden-Fields

If you're planning to reuse ajaxable UserControls a lot or your website is public, you might want to consider the control security model at least.

Thank you Michael, I will consider it, althought neither it is a public website nor it is intended to reuse user controls heavily.

Regards.