OnClientClicking="return false;" issue

4 posts, 0 answers
  1. Yana
    Yana avatar
    6 posts
    Member since:
    Sep 2014

    Posted 17 Jul Link to this post

     

    I have the following button:

                      <telerik:RadLinkButton ID="lbtn" runat="server" Text="Delete"
                                           Height="34px" 
                                           style="margin-top:2px;"
                                           OnClientClicking="return false;">
                        <Icon CssClass="rbRemove"></Icon>
                    </telerik:RadLinkButton>

     

    It does that i need it to do however causes "Uncaught SyntaxError: Unexpected token return" javascript error.

    What is wrong?

    Thank you

  2. Rumen
    Admin
    Rumen avatar
    14107 posts

    Posted 18 Jul Link to this post

    Hello Yana,

    The OnClientClicking event property can receive as a value a function name. 

    Here is an example:

    <telerik:RadLinkButton ID="lbtn" runat="server" Text="Delete"
                                           Height="34px" 
                                           style="margin-top:2px;"
                                           OnClientClicking="MyFunctionName">
                        <Icon CssClass="rbRemove"></Icon>
    </telerik:RadLinkButton>
    <script>
    function MyFunctionName(sender, args) {
    return false; }
    </script>

    Regards, Rumen
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Yana
    Yana avatar
    6 posts
    Member since:
    Sep 2014

    Posted 23 Jul in reply to Rumen Link to this post

    Thank you Rumen!
  4. Rumen
    Admin
    Rumen avatar
    14107 posts

    Posted 23 Jul Link to this post

    You are welcome, Yana! Keep up the good work.

    Regards,
    Rumen
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top