Populate server-side values to client side javascript variables

Contributed by
Rating: 3 stars3 stars3 stars3 stars3 stars / 13
September 16, 2000
Rate this Article:
MEH MEH++


SEARCH ASP FREE
TOOLS YOU CAN USE

advertisement



<%@ Language=VBScript %>
<% Response.Buffer=true%>
<%
set remoteConn = Server.CreateObject("ADODB.Connection")%>
remoteConn.Open "FILEDSN","uid","pwd"%>

<%
'code by Manikantan
'Web Developer
'3rd Agenda
'Nungambakkam, Chennai India

%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">

<SCRIPT LANGUAGE="Javascript">
var arr = new Array()
var arr1 =new Array()

<% sql="select name,e_mail from emptable" %>
<% set rec11=remoteconn.execute(sql) %>
<% counter1=0 %>

<% while not rec11.eof %>
          <% response.write "arr" & "[" & counter1 & "]" & "=" & rec11.fields(0)& ";" %>
          <% response.write "arr1" & "[" & counter1 & "]" & "=" & rec11.fields(1)& ";" %>
          <% counter1=counter1+1 %>
          <% rec11.movenext %>
<% wend %>

<% set rec11= nothing %>

</script>

<body>
This page contains an array that can be accessed by javascript...
The array values are populated in the server with server side objects..
</body>
</html>

blog comments powered by Disqus
ASP CODE ARTICLES

- ASP Forms
- ASP: The Beginning
- Getting Remote Files With ASP Continued
- Inbox and Outbox Manipulation in ASP
- Relational DropDownList Using VB.NET
- Ad Tracking URL Hits
- Use ViewState to display one record per page...
- Send Email using ASP.NET formatted in HTML
- ASP File Explorer
- ASP/XML Interview questions by Srivatsan Sri...
- Pressing RETURN won't submit the form
- This shows how you get the TEXT of a combo r...
- Group Data by Adrian Forbes
- Multiple checkbox select sample
- Multiple checkbox select with all values sam...

ASP Web Hosting ASP.Net Web Hosting Windows Web Hosting
 
 
 

ASP Free Forums 
 RSS  Tutorials RSS
 RSS  Forums RSS
 RSS  All Feeds
Site Map 
Request Media Kit
Write For Us Get Paid 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Privacy Policy 
Support 


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 10 - Follow our Sitemap
Most Popular Topics
All ASP.Net Tutorials