Calling a javascript library from ASP.NET
<p>This is a fairly newbie question I'm sure. I'm looking at replacing our server side charting library with the open source javascript library 'flot'. I can use ASP in the javascript used to call the library as per the following example</p>

<pre><code>&lt;div id="placeholder" style="width: 600px; height: 300px;"&gt;
&lt;/div&gt;
&lt;script type="text/javascript"&gt;
    $(function () {
        var d = [&lt;%
        for (var i = 0; i &lt; 10; i++) {
            if(i &gt; 1)  
                Response.Write(",");  

            Response.Write("[" + i + "," + Math.Sin(i) + "]");
        }%&gt;];

        $.plot($("#placeholder"), [d]);
    });
&lt;/script&gt;
</code></pre>

<p>This works a charm but what I really need to do is display data from a method in my code behind file (and ultimately a database). A quick Google suggests that I need to use AJAX to accomplish this but I would like to do it on page load.</p>

<p>It strikes me as something that should be simple to do but then I am relatively new to web development (I'm a windows forms developer by trade and an MS Certified one at that so I know my way around C#).</p>

<p>Any help or pointers would be greatly appreciated.</p>

<p>Cheers,</p>

<p>Neil.</p>
