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

OnClientClicking="return false;" issue

3 Answers 91 Views
LinkButton
This is a migrated thread and some comments may be shown as answers.
Yana
Top achievements
Rank 1
Veteran
Yana asked on 17 Jul 2019, 08:21 PM

 

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

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 18 Jul 2019, 06:03 AM

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.
0
Yana
Top achievements
Rank 1
Veteran
answered on 23 Jul 2019, 04:02 PM
Thank you Rumen!
0
Rumen
Telerik team
answered on 23 Jul 2019, 04:18 PM
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.
Tags
LinkButton
Asked by
Yana
Top achievements
Rank 1
Veteran
Answers by
Rumen
Telerik team
Yana
Top achievements
Rank 1
Veteran
Share this question
or