Passing Arrays to Javascript

Discussion in 'ASP .Net' started by hclarius, Apr 14, 2004.

  1. hclarius

    hclarius Guest

    I am populating a Session array from a database query. I would like to
    transfer this array to a javascript array to avoid going back to the server.
    How?
    hclarius, Apr 14, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?QmluIFNvbmcsIE1DUA==?=, Apr 14, 2004
    #2
    1. Advertising

  3. hclarius

    hclarius Guest

    Looks somewhat promising. I will play with the syntax.
    Thanks.

    "Bin Song, MCP" <> wrote in message
    news:...
    > Hi,
    >
    > You can try Page.RegisterArrayDeclaration method in Page_Prerender Event.

    See reference at:
    >

    http://msdn.microsoft.com/library/d...bUIPageClassRegisterArrayDeclarationTopic.asp
    >
    > Bin Song, MCP
    >
    > ----- hclarius wrote: -----
    >
    > I am populating a Session array from a database query. I would like

    to
    > transfer this array to a javascript array to avoid going back to the

    server.
    > How?
    >
    >
    >
    hclarius, Apr 14, 2004
    #3
  4. hclarius

    hclarius Guest

    Actually, I created a string using String.Join("|",Arrayname), then passed
    the string to a hidden fields value and then passed the string to javascript
    and created an array using stringname.split("|");

    Thanks

    "Bin Song, MCP" <> wrote in message
    news:...
    > Hi,
    >
    > You can try Page.RegisterArrayDeclaration method in Page_Prerender Event.

    See reference at:
    >

    http://msdn.microsoft.com/library/d...bUIPageClassRegisterArrayDeclarationTopic.asp
    >
    > Bin Song, MCP
    >
    > ----- hclarius wrote: -----
    >
    > I am populating a Session array from a database query. I would like

    to
    > transfer this array to a javascript array to avoid going back to the

    server.
    > How?
    >
    >
    >
    hclarius, Apr 15, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alexandra Stehman
    Replies:
    5
    Views:
    30,608
    Chris Smith
    Jun 17, 2004
  2. Bill Reyn
    Replies:
    3
    Views:
    2,254
    Bob Hairgrove
    Jun 22, 2004
  3. Mantorok Redgormor

    initializing arrays of arrays

    Mantorok Redgormor, Sep 10, 2003, in forum: C Programming
    Replies:
    4
    Views:
    566
  4. Philipp
    Replies:
    21
    Views:
    1,127
    Philipp
    Jan 20, 2009
  5. Eric Capps

    Passing arrays to Java from JavaScript

    Eric Capps, Jul 21, 2006, in forum: Javascript
    Replies:
    0
    Views:
    79
    Eric Capps
    Jul 21, 2006
Loading...

Share This Page