LinkButton doesn't fire OnClick

2 posts, 0 answers
  1. Radoslaw
    Radoslaw avatar
    1 posts
    Member since:
    Jan 2013

    Posted 06 Mar 2013 Link to this post


    The situation is as follows - in my RadGrid, in GridTemplateColumn, I've got a RadButton that is supposed to fire OnClick button. I also have SelectedIndexChanged assigned for the same RadGrid. When the button type was set to StandardButton, everything worked just fine - onClick event was triggered every time I clicked the button. I had to change button type to LinkButton, though (for styling reasons), and from that moment on, clicking the button fires SelectedIndexChanged event, instead (in 90% of cases). How can I force it to raise (or prioritise) OnClick event again?

  2. Danail Vasilev
    Danail Vasilev avatar
    1502 posts

    Posted 11 Mar 2013 Link to this post

    Hi Radoslaw,

    There is an issue related to the triggering of the server-side OnClick event of the RadButton when its ValidationGroup property is set in Q1 2013.

    This issue has already been fixed and the latest internal build (2013.1.227) reflects this fix. The internal build can be used for development and you can download it from  this page.

    The fix will also be reflected in the upcoming Q1 2013 SP1 which is scheduled for the beginning of April. For the time being you can use the following workaround:
    <script type="text/javascript">
        Telerik.Web.UI.RadButton.prototype._buildPostBackOptions = function() {            
            var options = this._getPostBackOptions() || {
                eventTarget: this.get_uniqueID(),
                eventArgument: this.get_enableSplitButton() ? 'RadButtonEventArguments': '',
                validation: this._validationGroup ? true: false,
                validationGroup: this._validationGroup,
                actionUrl: this._navigateUrl || '',
                trackFocus: false,
                clientSubmit: !this.IsInputTypeSubmit() || this.get_singleClick() || this.get_buttonType() != Telerik.Web.UI.RadButtonType.StandardButton || this.IsImageButton(),
            return "new WebForm_PostBackOptions('" + options.eventTarget + "', '"
                + options.eventArgument + "', "
                + options.validation + ", '"
                + options.validationGroup + "', '"
                + options.actionUrl + "', "
                + options.trackFocus + ", "
                + options.clientSubmit + ")";
    Make sure that this function override should be placed at the end of your page.

    You can also find more information on this matter in this sticky thread.

    Danail Vasilev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top