title: How to build a javascript function as an object in C#?
body: <p>I want to build an object in C# like this.</p>
  
  <pre><code>public JsonResult GetMyObject(){
  var MyObject = 
      new 
      {
        Myfunction = "function (params) {
              var res = params[0].seriesName + ' ' + params[0].name;
              res += '&lt;br/&gt;  Start : ' + params[0].value[0] + '  Max : ' + params[0].value[3];
              res += '&lt;br/&gt;  End : ' + params[0].value[1] + '  Min : ' + params[0].value[2];
              return res;
          }",
        Element1 = "Test Element",
        Element2 = 123
      };
      return Json(MyObject);
  }
  </code></pre>
  
  <p>But when I return the json object to javascript, the "Myfunction" element in  MyObject is just a string, not a javascript function.</p>
  
  <p>How can I build a javascript function as an object in C#?</p>