Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting array from Server side to client side?

Status
Not open for further replies.

MNClimber

Programmer
Nov 26, 2001
39
0
0
US
Is there a way I can get a 2-d array from server side ASP code to the cient side VBScript code??

TIA

Mike
 
Use ASP code to write VBScript code on the page. The VBScript code should be done in such a way that it will load the array client side. Remember, the ASP code will execute on the server, create the VBScript, send it to the client and then the client will execute the VBScript.
 
Try this :

Code:
<%
my_prog = Request(&quot;prog&quot;)
%>
<script language=&quot;VBScript&quot;>
<!--
  function launch()
    set shell = createObject(&quot;wscript.shell&quot;)
    prog = &quot;<%= my_prog %>&quot;
    shell.run (prog)
  end function
//-->
</script>

<a href=&quot;VBScript:launch()&quot;>Launch application</a>
Regards

Big Dave

davidbyng@hotmail.com


** If I am wrong I am sorry, but i'm only trying to help!! **

 
The only real way you can do it is to write it out into a client-side scripting language array (such as JavaScript or VBScript). Basically like so:

<script language=&quot;JavaScript&quot;>
<% for j = 1 to 5 %>
jsarray(<%=j%>) = &quot;<%=asparray(j)%>&quot;;
<% next %>
</script>

When it prints out it will look like so:

<script language=&quot;JavaScript&quot;>
jsarray(1) = &quot;a&quot;;
jsarray(2) = &quot;b&quot;;
jsarray(3) = &quot;c&quot;;
jsarray(4) = &quot;d&quot;;
jsarray(5) = &quot;e&quot;;
</script>

Otherwise you can't pass complex objects like arrays like you would normal simple variables.
Harold Blackorby
hblackorby@scoreinteractive.com
St. Louis, MO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top