protected override void OnInit(EventArgs e) { // Store client ID before replaced by short ID (original ID is needed when sending AJAX request to identify the control) originalClientId = ClientID; var parameters = Request.Form["params"]; if (parameters != null) { if (parameters.StartsWith(CALLBACK_ID + originalClientId, StringComparison.Ordinal)) { string[] args = parameters.Split(new[] { CALLBACK_SEP }, StringSplitOptions.None); AutomationManager.Mode = FormModeEnum.Update; AutomationManager.ClearObject(); AutomationManager.ObjectType = ValidationHelper.GetString(args[1], null); AutomationManager.ObjectID = ValidationHelper.GetInteger(args[2], 0); Response.Clear(); if (Step != null) { Response.Write(CALLBACK_ID + AutomationManager.GetAutomationInfo() + CALLBACK_SEP + AutomationManager.RefreshActionContent.ToString().ToLowerCSafe() + CALLBACK_SEP + Step.StepID); } else { Response.Write(CALLBACK_ID + AutomationManager.GetAutomationInfo() + CALLBACK_SEP + "false" + CALLBACK_SEP + "0"); } Response.End(); return; } } base.OnInit(e); // Perform full post-back if not in update panel menu.PerformFullPostBack = !ControlsHelper.IsInUpdatePanel(this); }
protected override void OnLoad(EventArgs e) { // Handle callback in OnLoad event because of ShortIDs var parameters = Request.Form["params"]; if (parameters != null) { if (parameters.StartsWith(CALLBACK_ID + ClientID)) { string[] args = parameters.Split(new string[] { CALLBACK_SEP }, StringSplitOptions.None); AutomationManager.Mode = FormModeEnum.Update; AutomationManager.ClearObject(); AutomationManager.ObjectType = ValidationHelper.GetString(args[1], null); AutomationManager.ObjectID = ValidationHelper.GetInteger(args[2], 0); Response.Clear(); if (Step != null) { Response.Write(CALLBACK_ID + AutomationManager.GetAutomationInfo() + CALLBACK_SEP + AutomationManager.RefreshActionContent.ToString().ToLowerCSafe() + CALLBACK_SEP + Step.StepID); } else { Response.Write(CALLBACK_ID + AutomationManager.GetAutomationInfo() + CALLBACK_SEP + "false" + CALLBACK_SEP + "0"); } Response.End(); return; } } base.OnLoad(e); // Perform full post-back if not in update panel menu.PerformFullPostBack = !ControlsHelper.IsInUpdatePanel(this); }