Adding values from C# to DIV via JavaScript
<p>The last module of my chat script is passing values from C# code to JavaScript and JavaScript will post values to the DIV. Before I used DataBinder but when using it directly C# code is taken by AJAX's update panel. Now, I need a set of Array values to be passed via Timer Tick function to JavaScript. How can I pass Arrays from C# to JavaScript using <code>&lt;%= %&gt;</code>. A part of my code follows.</p>

<pre><code>protected void Timer1_Tick(object sender, EventArgs e)
    {
        if (MyConnection.State == System.Data.ConnectionState.Open)
        {
            MyConnection.Close();
        }
        MyConnection.Open();
        OdbcCommand cmd = new OdbcCommand("Select message from messages where name=?", MyConnection);
        cmd.Parameters.Add("@email", OdbcType.VarChar, 255).Value = "human";
        OdbcDataReader dr = cmd.ExecuteReader();
        ArrayList values = new ArrayList();
        while (dr.Read())
        {
            string messagev = dr[0].ToString();
            // What should I do here?
        }
        MyConnection.Close();
    }
</code></pre>

<p>I don't want values to directly to be sent to the DIV. First it must be sent to JavaScript and then it must go to DIV.</p>

<p><strong>For more clarification</strong></p>

<p>I need C# to retrieve data from backend and to pass that data to client side (i.e. JavaScript) from JavaScript it has to be forwarded to DIV layer.</p>
