AJAX support

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

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.

 

devguide_clip0380

 

 

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, "");

 

Page url: http://devnet.kentico.com/docs/devguide/index.html?ajax_support.htm