If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Access server-side array from client script

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-21-04, 11:00
rweide rweide is offline
Registered User
 
Join Date: Aug 2004
Location: USA
Posts: 54
Access server-side array from client script

I have an array that's declared and filled in ASP code, now how can I access this array in client-side VBScript? I understand one is done on server, and the other is in client, but how do you cross this line and using something in the middle to interface with each other?

Thanks.
Reply With Quote
  #2 (permalink)  
Old 03-25-09, 07:11
farrukhiftikhar farrukhiftikhar is offline
Registered User
 
Join Date: Mar 2009
Posts: 1
Access server-side array from client script

there are two ways to do that.

1.

var arr = [<%=yourarray %>];

2.


-------------------------------------------------
ServerSide script
-------------------------------------------------
Public mAddressList As String

Dim builder As StringBuilder = New StringBuilder()
Dim first As Boolean = True
For Each item As SurveyorInfo In mSurveyorList
If first Then
first = False
Else
builder.Append(","C)
End If
builder.Append("'"C).Append(item.Address.Replace(" \","\\").Replace("'","\'")).Append("'"C)
Next
mAddressList = builder.ToString()

-------------------------------------------------
ClientSide script
--------------------------------------------------

var addressString = [<%=mAddressList%>];

for (x=0; x<addressString.length; x++) {
map.Find(null, addressString[x], null, null, 0, 10, true, true, true, true, callback);
}
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On