Why can't I send data from c# to Javascript file in asp.net?
<p>I have a list of a class created in c# that I have to send its values to a javascript file.
I have created a string in c# and put the values of the list in it:</p>

<pre><code>count = 0;
JString = "[";
for(i=0; i&lt;x; i++)
{
    JString += "{Source:" + A[i] + ", Number:" + 3 + ", Target:" + B[i] + "},";
    count++;
}
JString = JString.Remove(JString.Length - 1, 1); //to remove the last ,
JString += "]";
GraphData.Text = "" + "var JString =" + JString + " ;" + "var count =" + count + " ;";
</code></pre>

<p>GraphData is a label to save the string.</p>

<p>In the JavaScript file, I added:</p>

<pre><code> $("#GraphData").val(); //to get the string sent
</code></pre>

<p>But it's not working this way.
Am I doing something wrong? </p>

<p>Thanks in advance:)</p>
