/// <summary> /// Adds the <strong>onclick</strong> attribute to invoke a callback from the client, then renders /// the attributes of the control to the output stream. /// </summary> protected override void AddAttributesToRender(HtmlTextWriter writer) { EventHandlerManager.AddScriptAttribute( this, "onclick", EventHandlerManager.GetCallbackEventReference( this, this.CausesValidation, this.ValidationGroup ) + "return false;" ); base.AddAttributesToRender(writer); }
/// <summary> /// Adds the <strong>onclick</strong> attribute to invoke a callback from the client, then renders /// the attributes of the control to the output stream. /// </summary> protected override void AddAttributesToRender(HtmlTextWriter writer) { EventHandlerManager.AddScriptAttribute( this, "onclick", EventHandlerManager.GetCallbackEventReference( this, this.CausesValidation, this.ValidationGroup, this.ImageUrlDuringCallBack == string.Empty ? string.Empty : this.ResolveUrl(this.ImageUrlDuringCallBack) ) + "return false;" ); base.AddAttributesToRender(writer); }
/// <summary> /// Use OnPreRender. AddAttributesToRender is not called in ASP.NET 1.1. /// </summary> /// <param name="e"></param> protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); if (AutoCallBack) { EventHandlerManager.AddScriptAttribute( this, "onclick", EventHandlerManager.GetCallbackEventReference( this, this.CausesValidation, this.ValidationGroup ) ); } }
/// <summary> /// Adds the <strong>onchange</strong> attribute to invoke a callback from the client, then renders /// the attributes of the control to the output stream. /// </summary> protected override void AddAttributesToRender(HtmlTextWriter writer) { if (AutoCallBack) { EventHandlerManager.AddScriptAttribute( this, "onchange", EventHandlerManager.GetCallbackEventReference( this, this.CausesValidation, this.ValidationGroup ) ); } base.AddAttributesToRender(writer); }
/// <summary> /// Adds the <strong>onclick</strong> attribute to invoke a callback from the client, then renders /// the attributes of the control to the output stream. /// </summary> protected override void AddAttributesToRender(HtmlTextWriter writer) { base.AddAttributesToRender(writer); if (this.DisplayMode == ASP.BulletedListDisplayMode.LinkButton) { for (int index = 0; index < this.Items.Count; index++) { ASP.ListItem item = this.Items[index]; EventHandlerManager.AddScriptAttribute( this, item, "onclick", EventHandlerManager.GetCallbackEventReference( this, index.ToString(), this.CausesValidation, this.ValidationGroup ) + "return false;" ); } } }
/// <summary> /// Adds the <strong>onclick</strong> attribute to invoke a callback from the client. /// </summary> protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); if (AutoCallBack) { EventHandlerManager.AddScriptAttribute( this, "onclick", string.Format( "AnthemListControl_OnClick(event,{0},'{1}','{2}',{3},{4},{5},{6});", this.CausesValidation ? "true" : "false", this.ValidationGroup, this.TextDuringCallBack, this.EnabledDuringCallBack ? "true" : "false", (this.PreCallBackFunction == null || this.PreCallBackFunction.Length == 0) ? "null" : this.PreCallBackFunction, (this.PostCallBackFunction == null || this.PostCallBackFunction.Length == 0) ? "null" : this.PostCallBackFunction, (this.CallBackCancelledFunction == null || this.CallBackCancelledFunction.Length == 0) ? "null" : this.CallBackCancelledFunction ) ); // Disable postback so there is no double callback+postback ASP.CheckBox controlToRepeat = (ASP.CheckBox) this.Controls[0]; controlToRepeat.AutoPostBack = false; } }