This is a migrated thread and some comments may be shown as answers.

SingleClick="True" but throw new exception in codebehind

3 Answers 20 Views
Button
This is a migrated thread and some comments may be shown as answers.
wk
Top achievements
Rank 1
wk asked on 12 Aug 2014, 02:16 AM
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?

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 12 Aug 2014, 04:23 AM
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.


0
wk
Top achievements
Rank 1
answered on 18 Aug 2014, 02:25 AM
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");
   }

0
wk
Top achievements
Rank 1
answered on 18 Aug 2014, 02:27 AM
I use RadWindows to show the exception, and after throw exception the save button is disable
Tags
Button
Asked by
wk
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
wk
Top achievements
Rank 1
Share this question
or