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

get_text problem

1 Answer 61 Views
Button
This is a migrated thread and some comments may be shown as answers.
Donald Norris
Top achievements
Rank 1
Donald Norris asked on 24 Jul 2012, 04:39 AM
I have attempted a file where I setup to use a RadButton.  I wanted to call a client-side routine on click and change the text of the button from Update to Updating, then execute server-side code for the click event.  I also want to test the text and if is not equal to update then do not allow executing the server-side code again.

The problem is I get a compiler error everytime and way I try to use the get_text() function.  Please look at the code and tell me what I am doing wrong.

Thanks

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 24 Jul 2012, 05:30 AM
Hello,

I tried to reproduce your issue in telerik version 2012, 2, 607, 40 and it is working fine at my end. Here is the sample code.

ASPX:
<telerik:RadButton ID="RadButton1" runat="server" Text="Update"  OnClientClicking="OnClientClicking" onclick="RadButton1_Click">
</telerik:RadButton>

JS:
<script type="text/javascript">
    function OnClientClicking(sender, args) {
        sender.set_text("Updating");
 
        //Canceling the click event when the text is Update
        if (sender.get_text() == "Update") {
            args.set_cancel(true);
        }
    }
</script>

Please provide your code if it doesn't helps.

Regards,
Princy.
Tags
Button
Asked by
Donald Norris
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or