views:

198

answers:

1

Hi, I have been working with syncron calls in AjaxPro, and I am now looking into asyncron calls. I have been looking at the example Here

My question is how do I pass variables to my ajaxpro method? I would like to add some properties to the AjaxMethod MyMethod, but how is it done?

<script type="text/javascript">
function callback(res) {
    alert(res.value);
}
function invokeMyMethod() {
    Namespace.Classname.MyMethod(callback);
}
</script>
+1  A: 

Your server-side method will look like this:

public void MyMethod(int param1, string param2, ...)

You need to call this from the client like so:

Namespace.Classname.MyMethod(param1, param2, callback);

That should do it.

David Andres
Worked perfectly, thanks.
Dofs
@Dofs, you're welcome
David Andres