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

RadTextBox Client Side Event At Runtime

1 Answer 87 Views
Input
This is a migrated thread and some comments may be shown as answers.
Johnny
Top achievements
Rank 2
Johnny asked on 12 Jul 2011, 05:04 AM
hi i set Client Side event for RadTextBox like following line

 

 

Dim rtb As New RadTextBox

 

rtb.ClientEvents.OnValueChanged =

 

"gettext('" & row("LField").ToString.Trim  & "')"

Problem 1 : The event fires after the above line executes
Problem 2 : I getting the following Javascript Error

Microsoft JScript runtime error: Sys.InvalidOperationException: Handler must be a function.

the function in Seperate Javascript file
how to solve this Problem

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 12 Jul 2011, 10:52 AM
Hello Johnny,

The RadControls expects only two parameters as its arguments, sender and arguments. You cannot pass the extra arguments directly.
The easiest way to pass predefined parameters to a function executed on the clientside, is to assign anonymous function and pass the parameters as shown below.

VB:
Dim rtb As New RadTextBox
rtb.ClientEvents.OnValueChanged = "function (sender,args){gettext('" & LField & "');}"

Thanks,
Princy.
Tags
Input
Asked by
Johnny
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Share this question
or