Hello Andrew
I suggest that you change your code in the following manner:
protected void Page_Load(object sender, EventArgs e) {
if(Session["Loaded"] != null)
LoadUserControl();
}
protected void cbpContent_Callback(object source, CallbackEventArgsBase e) {
LoadUserControl();
Session["Loaded"] = true;
}
private void LoadUserControl(){
Control control2Render = null;
ASPxCallbackPanel panel = source as ASPxCallbackPanel;
//
String controlPath = "~/TestUC.ascx";
if(File.Exists(Server.MapPath(controlPath))) {
control2Render = LoadControl(controlPath);
}
if(control2Render != null) {
panel.Controls.Clear();
panel.Controls.Add(control2Render);
}
}
Thanks, Roman
R&D, .Net Team, DevExpress
PS. If you wish to receive direct assistance from our Support Team, use
Support Center.