protected override void OnInit(EventArgs e) { if (Page is JavascriptPage && ((JavascriptPage)Page).FindJavascriptControls == false) { JavascriptPage page = (JavascriptPage)Page; page.AddJsonControl(this); } base.OnInit(e); }
/// <summary> /// This method is called by the BoxServer so the JsonControls can /// find each other and do their necessary wiring. /// </summary> /// <param name="renderScripts">true to render scripts.</param> internal void PostBoxLoad(bool renderScripts, string requesterId, bool postWindowLoad) { List <JsonControl> jsonControls = GetAllJsonControls(this.Page); JavascriptPage page = this.Page as JavascriptPage; foreach (JsonControl control in jsonControls) { if (!string.IsNullOrEmpty(requesterId.Trim())) { control.DomId = string.Format("{0}_{1}", requesterId, control.DomId); } if (control is Box) { throw new BoxValidationException(this.Parent.AppRelativeTemplateSourceDirectory); } control.RenderScripts = renderScripts; control.PostWindowLoad = postWindowLoad; page.AddJsonControl(control); } page.WireJsonControls(false); }