If I want to inject a globally scoped array variable into a page's client-side javascript during a full page postback, I can use:
this.Page.ClientScript.RegisterArrayDeclaration("WorkCalendar", "\"" + date.ToShortDateString() + "\"");
to declare and populate a client-side javascript array on the page. Nice and simple.
But I want to do the same from a async postback from an UpdatePanel.
The closest I can figure so far is to create a .js file that just contains the var declaration, update the file during the async postback, and then use a ScriptManagerProxy.Scripts.Add
to add the .js file to the page's global scope.
Is there anything simpler? r iz doin it wrong?