AJAX support

Your web parts can use the UpdatePanel, which wraps the web part into the UpdatePanel. This can be easily done by enabling the Use update panel web part property of your web part.

 

clip0210

 

 

No further modifications are necessary, but the following rules should be followed:

 

1. ID of a control must be defined when loading the control dynamically:

 

Incorrect:

 

Control ctrl = this.LoadControl("~/MyControl.ascx");

if (ctrl != null)

{

   Controls.Add(ctrl);

}

 

 

Correct:

 

Control ctrl = this.LoadControl("~/MyControl.ascx");

if (ctrl != null)

{

   ctrl.ID = "myControl";

   Controls.Add(ctrl);

}

 

 

2. When requesting PostBackEventReference, use Kentico's custom function instead of the default one:

 

Incorrect:

 

this.Page.ClientScript.GetPostBackEventReference(this, "");

 

 

Correct:

 

CMS.ExtendedControls.ControlsHelper.GetPostBackEventReference(this, "");