Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004
    Location
    USA
    Posts
    54

    Unanswered: 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.

  2. #2
    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);
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •