I have a javascript class called MyTest.js, now I register this script on the load of my MyWebPage.cs, But i need to pass 3 parameters to the function which it will then make a call to a web service. Here is my javascript function
MyTest.init = function() {
var params = new Hash();
params.set("blank", "blank");
new Ajax.Request('/Test.asmx/CreateClients', {
method: 'post',
onSuccess: attachCallback(this, "Yay"),
onFailure: attachCallback(this, "Nay"),
onException: attachCallback(this, "Nay"),
parameters: params
});
}
Now the parameters i need to pass are two stings, name and notes which I can get in the load of my .cs file. How can I pass the values to this init function?
Thank you
Use the data property: