passing arrays to asp

  • Thread starter Thread starter ljilja
  • Start date Start date
L

ljilja

Is it possible to pass array toa client side script from
server side?

my code is something like:
MyDropDownList.Attributes.Add("onChange", "MyFunc
(aFrom,DropDownList2, this.value);")
where aFrom is created in VB and it is two dimensional
array.
My script is
function MyFunc(aFrom,Filter, strSeq)
{
....
}
 
Is it possible to pass array toa client side script from
server side?

No, but you can pass the array via cookies, querystring, or simply writing
out the entire array to the webpage in the form of a javascript array.
 
It isn't possible to PASS an array to a client-side JavaScript function, but
it is certainly possible to BUILD a client-side JavaScript array on the
server. Since JavaScript is just text in the Page, you simply create the
string that becomes an array on the client side, and use
Page.RegisterClientScriptBlock to add it to the Page.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
The more I learn, the less I know.
 
Back
Top