get_text problem

2 posts, 0 answers
  1. Donald Norris
    Donald Norris avatar
    66 posts
    Member since:
    Mar 2006

    Posted 23 Jul 2012 Link to this post

    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
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 24 Jul 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top