String from codebehind to array in Javascript
<p>Hi all i have code that reads from a DB and populates a string in the code behind</p>

<pre><code>List&lt;string&gt; rows = new List&lt;string&gt;();
    DataTable prods = common.GetDataTable("vStoreProduct", new string[] { "stpt_Name" }, "stpt_CompanyId = " + company.CompanyId.ToString() + " AND stpt_Deleted is null");

    foreach (DataRow row in prods.Rows)
    {

        prodNames += "\"" + row["stpt_Name"].ToString().Trim() + "\",";
    }
    string cleanedNanes =  prodNames.Substring(0, prodNames.Length - 1);
    prodNames = "[" + cleanedNanes + "]";
</code></pre>

<p>This produces something like ["Test1","Test2"]</p>

<p>In javascript i have </p>

<pre><code>var availableTags = '&lt;% =prodNames %&gt;';

alert(availableTags);
</code></pre>

<p>How can i access this like an array in javascript like</p>

<pre><code>alert(availableTags[5]);
</code></pre>

<p>and get the full item at the given index.</p>

<p>Thanks any help would be great</p>
