/// <summary> /// This method just builds the various JavaScript blocks as strings /// and assigns them to the ClientScript object. /// </summary> /// <param name="e"></param> protected override void OnPreRender(EventArgs e) { if (!IsCallback) { ClientScriptProxy = ClientScriptProxy.Current; // If we're not in a callback provide script to client if (!string.IsNullOrEmpty(jQueryScriptLocation)) { ScriptLoader.LoadjQuery(this.Page); } //ClientScriptProxy.LoadControlScript(this, jQueryScriptLocation, ControlResources.JQUERY_SCRIPT_RESOURCE, ScriptRenderModes.HeaderTop); ClientScriptProxy.LoadControlScript(this, ScriptLocation, ControlResources.WWJQUERY_SCRIPT_RESOURCE, ScriptRenderModes.Header); // Generate the class wrapper and class loader function GenerateControlSpecificJavaScript(); } else { if (PageProcessingMode == CallbackProcessingModes.PagePreRender) { HandleCallback(); } } }
/// <summary> /// Code that embeds related resources (.js and css) /// </summary> /// <param name="scriptProxy"></param> protected void RegisterResources(ClientScriptProxy scriptProxy) { scriptProxy.LoadControlScript(this, jQueryJs, ControlResources.JQUERY_SCRIPT_RESOURCE, ScriptRenderModes.HeaderTop); scriptProxy.RegisterClientScriptInclude(Page, typeof(ControlResources), CalendarJs, ScriptRenderModes.Header); string cssPath = CalendarCss; if (!string.IsNullOrEmpty(Theme)) { cssPath = cssPath.Replace("/base/", "/" + Theme + "/"); } scriptProxy.RegisterCssLink(Page, typeof(ControlResources), cssPath, cssPath); }
protected override void OnInit(EventArgs e) { base.OnInit(e); if (!DesignMode) { ScriptProxy = ClientScriptProxy.Current; // Use ScriptProxy to load jQuery and ww.Jquery if (!string.IsNullOrEmpty(jQueryScriptLocation)) { ScriptLoader.LoadjQuery(this); } ScriptProxy.LoadControlScript(this, ScriptLocation, ControlResources.WWJQUERY_SCRIPT_RESOURCE, ScriptRenderModes.Header); } }
/// <summary> /// Code that embeds related resources (.js and css) /// </summary> /// <param name="scriptProxy"></param> protected void RegisterResources(ClientScriptProxy scriptProxy) { scriptProxy.LoadControlScript(this, jQueryJs, WebResources.JQUERY_SCRIPT_RESOURCE, ScriptRenderModes.HeaderTop); scriptProxy.RegisterClientScriptInclude(Page, typeof(WebResources), CalendarJs, ScriptRenderModes.Header); string cssPath = CalendarCss; if (!string.IsNullOrEmpty(Theme)) cssPath = cssPath.Replace("/base/", "/" + Theme + "/"); scriptProxy.RegisterCssLink(Page, typeof(WebResources), cssPath, cssPath); }