Create JSON Object Using ASP.NET

时间:2017-05-01 15:49:06

标签: javascript c# asp.net json

Cytoscape.js JSON format is something like this :

var cy = cytoscape({
    style: [
    {
      selector: 'node',
      style: {
        shape: 'hexagon',
        'background-color': 'red',
        label: 'data(id)'
      }
    }],
  container: document.getElementById('cy'),
  elements: [
    { data: { id: 'a' }     },
    { data: { id: 'b' } },
    {
      data: {
        id: 'ab',
        source: 'a',
        target: 'b',
      }
    }]

});

I have been able to generate elements part myself, but I don't know how to generate other parts using C#. Should I do some kind of concatenation because other parts are not dynamic? If yes, how should I do that? Thanks.

0 个答案:

没有答案