Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Remote Scripting functions are not executing.

angel1234angel1234 Posts: 2Member
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.