I have a json function as shown below in aspx.
<script type="text/javascript">
var TotalData = new Array();
function Show()
{
TotalData[0] = "Jan, 25";
TotalData[1] = "Feb, 42";
alert("hai");
}
I want to assign the same array from c# page load and need to call the js function Show(). How to do it?
protected void Page_Load(object sender, EventArgs e)
{
//string[,] TotalData = new string[2, 2] { { "Jan", "25" }, { "Feb", "42" } };
//string serializedNumbers = (new JavaScriptSerializer()).Serialize(TotalData);
//need to assign TotalData array here.instead in javascript.
ClientScript.RegisterStartupScript(GetType(), "Javascript", "javascript:Show(); ", true);
}