Javascript function in asp.net
<p>Ok, having an issue withe the return value of a function always returning "undefined"</p>

<p>Heres my code:</p>

<pre><code>//called here:
var res = comms(GENSET_SN);

//the function
function comms(genserial) {
     var Result; 
     //Webservice called here
     MyServices.getCommsState(genserial, "S1", OnComplete1);

     function OnComplete1(args) {
          var Res = eval("(" + args + ")");

          if (Res == 1) {
               Result = 1;
          } else {
                Result = 0;
          }
      }
      return Result;
}
</code></pre>

<p>please help!!</p>
