RadTextBox Client Side Event At Runtime

2 posts, 1 answers
  1. Johnny
    Johnny avatar
    86 posts
    Member since:
    Dec 2010

    Posted 12 Jul 2011 Link to this post

    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

     

  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 12 Jul 2011 Link to this post

    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.
Back to Top