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

Calling Code Behind Function Through JavaScript With Parameters

3 Answers 724 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Siingh
Top achievements
Rank 2
Siingh asked on 25 May 2010, 05:02 AM
Hi
I want to call Codebehind function from javascript with parameters, then update the radajax panel
e.g
CodeBehind
public function CallCodeBehind(byval InValue as string) as boolean
        code......    
end function

Javascript
    function FromJavascript(){
    var InValue='1';        
    <    What to do here?    >

    }

Now what should i write in <what to do here > code to execute codebehind function with parameters and then update the radajax panel to display new values.


Kind Regards:
Hariindarr Siingh
McConnell Dowell

3 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 25 May 2010, 06:30 AM

Hello Hariindarr Siingh,

Better approach would be invoking an ajaxRequest() to server side and executing the code in RadAjaxManager1_AjaxRequest server event.

The documentation explains more on this:

Client-Side API

Hope this helps,

Shinu.

0
Siingh
Top achievements
Rank 2
answered on 27 May 2010, 04:40 AM
Hi Telerik
can you provide me example how to pass multiple parameters?
e.g i got two parameters one is Int second is string how do i pass through argument?


Kind Regards:
0
Accepted
Shinu
Top achievements
Rank 2
answered on 27 May 2010, 06:49 AM

Hello Singh,

Passing multiple parameters can be achieved by joining the arguments in client side and splitting them on the server in the AjaxManager_AjaxRequest.

The documentation shows how to perform this.

-Shinu.

Tags
Ajax
Asked by
Siingh
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Siingh
Top achievements
Rank 2
Share this question
or