SingleClick="True" but throw new exception in codebehind

4 posts, 0 answers
  1. wk
    wk avatar
    3 posts
    Member since:
    Aug 2014

    Posted 11 Aug 2014 Link to this post

    1,SingleClick="True"
    2,we have some validator at codebehind

    when throw new exception("XXXX"), the button is disabled.

    how can i make it enabled?
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 11 Aug 2014 in reply to wk Link to this post

    Hi,

    The provided information is not enough to replicate the issue. The single click button is used to avoid multiple postbacks/callbacks to the server. This feature is useful in database and/or e-mail send scenarios when the developer should prevent submitting of identical content multiple times to the server. Please have a look into this help documentation and online demo for further information. 

    Let me know if you have any concern.
    Thanks,
    Princy.


  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. wk
    wk avatar
    3 posts
    Member since:
    Aug 2014

    Posted 17 Aug 2014 in reply to Princy Link to this post

    Hi Princy,
    This is my code:
    <telerik:RadButton ID="save" runat="server" Text="Save" OnLoad="saveButton_Load" OnClick="saveButton_Click" Skin="Office2007" SingleClick="True" SingleClickText="Saving">
                <Icon PrimaryIconCssClass="rbSave" PrimaryIconLeft="4" PrimaryIconTop="3"></Icon>
    </telerik:RadButton>
    <telerik:RadButton ID="cancel" runat="server" Text="Cancel" OnClick="cancelButton_Click" CausesValidation="false" Skin="Office2007">
                <Icon PrimaryIconCssClass="rbCancel" PrimaryIconLeft="4" PrimaryIconTop="3"></Icon>
    </telerik:RadButton>

    protected override void saveButton_Click(object sender, EventArgs e)
       {
           var amountTxt = (TextBox)FormView1.FindControl("Amount");
           if (amountTxt != null && string.IsNullOrEmpty(amountTxt.Text)) amountTxt.Text = "-1";
     
           throw new Exception("TEST");
       }

  5. wk
    wk avatar
    3 posts
    Member since:
    Aug 2014

    Posted 17 Aug 2014 in reply to wk Link to this post

    I use RadWindows to show the exception, and after throw exception the save button is disable
Back to Top