/// <summary> /// The method gets notified from the server control and performs any necessary /// pre-rendering steps prior to saving view state and rendering content /// </summary> /// <param name="e">Contains the event data</param> protected override void OnPreRender(EventArgs e) { // Order is important. // The control's JavaScript component relies on Prototype being present first. PrototypeManager.Load(this.Page); JSManager.AddResource(this.Page, typeof(AutoComplete), "NCI.Web.UI.WebControls.FormControls.Resources.AutoComplete.js"); CssManager.AddResource(this.Page, typeof(AutoComplete), "NCI.Web.UI.WebControls.FormControls.Resources.AutoComplete.css"); // Register this control to require postback handling when the page // is posted back to the server Page.RegisterRequiresPostBack(this); }
/// <summary> /// Register the control to be notified of postback events. /// </summary> /// <param name="e"></param> protected override void OnPreRender(EventArgs e) { ClientScriptManager cs = Page.ClientScript; Type myType = typeof(TwoListSelect); // Order is important. // The control's JavaScript component relies on Prototype being present first. PrototypeManager.Load(this.Page); JSManager.AddResource(this.Page, typeof(TwoListSelect), "NCI.Web.UI.WebControls.FormControls.Resources.TwoListSelect.js"); Page.RegisterRequiresPostBack(this); base.OnPreRender(e); }
protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); PrototypeManager.Load(this.Page); JSManager.AddResource(this.Page, typeof(DHtmlModalPopup), "NCI.Web.UI.WebControls.Resources.DHtmlModalPopup.js"); //Remove any styles that we do not want! Must be done here because control state gets stored right after prerender. this.Style.Remove(HtmlTextWriterStyle.Display); this.Style.Remove(HtmlTextWriterStyle.Position); this.Style.Remove(HtmlTextWriterStyle.Top); this.Style.Remove(HtmlTextWriterStyle.Left); this.Style.Remove(HtmlTextWriterStyle.ZIndex); //This popup should not show up by default. this.Style.Add(HtmlTextWriterStyle.Display, "none"); }
/// <summary> /// Sets up the prototype library and the javascript on the page. /// </summary> /// <param name="e"></param> protected override void OnPreRender(EventArgs e) { //Do not render this stuff if there are no controls. This avoids unnessasary JS includes //and possible broken JS. if (this.Controls.Count < 1) { this.Visible = false; return; } // Order is important. // The control's JavaScript component relies on Prototype being present first. PrototypeManager.Load(this.Page); JSManager.AddResource(this.Page, typeof(TemplatedTreeView), "NCI.Web.UI.WebControls.Resources.TemplatedTreeView.js"); //string hiddenFieldClientID = this.ClientID + this.ClientIDSeparator + _hiddenFieldId; //string script = "document.getElementById('" + hiddenFieldClientID + "').value = " + this.ClientID + "_obj.getState('" + this.ClientID + "');"; //Page.ClientScript.RegisterOnSubmitStatement(typeof(TemplatedTreeView), hiddenFieldClientID, script); Page.RegisterRequiresPostBack(this); base.OnPreRender(e); }