I am trying to make a call to a C# function in the page's .aspx.cs
file called testFun()
from my javascript code and I want to pass 2 values to it. My javascript code looks a bit like this:
var questionsDone = 45;
var questionsCorrect = 23;
var exercisesDone = 65;
var exercisesCorrect = 12;
alert("<%= testFun() %>");
And my method to which I want to pass values looks like this:
public string testFun(double questionScore, double exerciseScore){
return "done";
}
What I want to do is pass 2 values, first one being (questionsCorrect/questionsDone)
and the seconds one being (exercisesCorrect/exercisesDone)
. Could anyone help me figure out how to do so?