Remote Scripting functions are not executing.

I am trying out with a sample program , which calls the Remote scripting function from client side.


Client side function.
<%@ Language=JavaScript %>








BODY { margin-top: 5px;
margin-left: 10px }







+
-
*
/









RSEnableRemoteScripting();
var res;
function MakeOperation()
{
alert(document.Form1.operation.options[
document.Form1.operation.selectedIndex
].value);
var params = new Array;
params[0] = document.Form1.operation.options[document.Form1.operation.selectedIndex].value;
params[1] = document.Form1.p1.value;
params[2] = document.Form1.p2.value

res = RSExecute(
"RemoteFunctions.asp",
"MakeOperation",
params,
SetResult,
ErrorCallback);
alert(res);
}

function SetResult()
{
alert("Inside SetResult RES Value...>"+res);
result.innerHTML = res;
}

function ErrorCallback()
{
alert("Error: "+res);
}



Server side function:

public double MakeOperation(
string operation,
string p1,
string p2)
{
double d1 = Convert.ToDouble(p1);
double d2 = Convert.ToDouble(p2);
double output = 0;
switch(operation)
{
case "add":
output = d1 + d2;
break;
case "sub":
output = d1 - d2;
break;
case "div":
output = d1 / d2;
break;
case "mul":
output = d1 * d2;
break;
}
return 2.0;
//return output;
}

When i try to run , code is not hitting the remote server function, return value is null from the server side.

can some one help me on this.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories