passing arrays to asp

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)
{
....
}
 
L

Lucas Tam

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.
 
K

Kevin Spencer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top