A
Ant
Hi,
I'd like to pass an array that is set set in the page load in code behind
into client side javascript so that I cache the array on the client. Can this
be done?
Basically this is what I want to do (This doesn't work but for purposes of
explanation):
Code behind:
protected void Page_Load(object sender, EventArgs e)
{
string[] myOP = {"test1", "test2"};
}
client javascript
function buttonClientSide_onclick() {
Array myOP = '<% = myOP %>';
alert(myOP[1]);
}
How can this be done?
Many thanks for any ideas
Ant
I'd like to pass an array that is set set in the page load in code behind
into client side javascript so that I cache the array on the client. Can this
be done?
Basically this is what I want to do (This doesn't work but for purposes of
explanation):
Code behind:
protected void Page_Load(object sender, EventArgs e)
{
string[] myOP = {"test1", "test2"};
}
client javascript
function buttonClientSide_onclick() {
Array myOP = '<% = myOP %>';
alert(myOP[1]);
}
How can this be done?
Many thanks for any ideas
Ant