Javascript array to vb array

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hey guys, I've searched high and low for a way to populate a vb array with
data from a javascript array. I can find 50 ways to do it with ASP but not
one for VB. I appreciate what help you can give.
 
What? You want to write a VB .NET program that has JavaScript in the VB?

You can do it with ASP but not VB? What does that mean? ASP is an
architecture, not a language. If you did what you want in an ASP page, then
you wrote it in, most likely VBScript. Can you post that code so we can
understand what it is you are trying to do?
 
I am automating a batch download of files from a web page. The url's of the
downloads are built from a combination of values stored in arrays on the
site. I have a windows application program built that navigates to the site,
does some preliminary stuff, and now needs to download the files needed to
complete the process. I have all the code for navigation and even the
downloader built, just need this last piece. This is an example of the issue
posted elsewhere.

http://www.thescripts.com/forum/thread91300.html


--
-John
Please rate when your question is answered to help us and others know what
is helpful.


Scott M. said:
What? You want to write a VB .NET program that has JavaScript in the VB?

You can do it with ASP but not VB? What does that mean? ASP is an
architecture, not a language. If you did what you want in an ASP page, then
you wrote it in, most likely VBScript. Can you post that code so we can
understand what it is you are trying to do?
 
Your problem is more complex than you think. It's not just a conversion
between JavaScript and VB .NET. It's the persistence of the client side
JavaScript object into the server-side processing of ASP .NET.

You'll first need to find a way to send the JavaScript array data (not the
array) to the server for the server-side code to extract. The most
straight-forward way would probably be hidden form fields and an automated
form submit function in the client-side code.
 
I was afraid of something like that. There are two javascript functions, one
that selects the rows and one that retrieves them, I have some code that can
run a javascript function but nothing along the lines of passing parameters.
Any ideas for that?
 
As I said, I think you'll need to write a new JavaScript function that
gathers the array data and sends it to the server (via a form submit,
perhaps).

I imagine the function would iterate over your array and add hidden form
fields to the DOM, then when done submit the form. The server-side code
would then just pull these submitted form values out of the Request object
as normal.
 
Back
Top